Abort Capistrano 2 deployment if remote is dirty

I configured Capistrano 2 to abort deployment if remote directory is dirty.

Because uncommited changes in remote directory will cause degrade.

# Of course, modifying source code in remote directory is bad, but sometimes we need to do it.

Read On 

Similar Articles on middleman-blog

I created a middleman-blog extension to lookup similar articles.

View middleman-blog-similar on GitHub.

gem 'middleman-blog-similar'
gem 'levenshtein-ffi', :require => 'levenshtein'
h2 Similar Entries
ul
  - similar_articles.first(5).each do|article|
    li= link_to article.title, article.url

You can retrieve similar articles from similar_articles helper method or Middleman::Blog::BlogArticle#similar_articles instance method.

Read On 

Exporting and importing iTerm 2 Color Schemes

I started to manage stuffs with dotfiles git repository instead of Boxen.

I managed iTerm 2 color schemes with puppet-iterm2 modules, that was very useful.

Read On 

Universal Code support for middleman-google-analytics

As Google announced, Universal Analytics became out of beta.

This blog is using middleman-google-analytics to embed Google Analytics code, so I need to paste the snippet or modify the extension to use Universal Analytics.

The extension helped me a lot, so I started improve that and sent pull requests.

Read On 

middleman-ogp

I released an OpenGraph Protocol helper extension for Middleman.

ngs/middleman-ogp on GitHub

In your Gemfile

gem 'middleman-ogp'

Read On 

Generating JavaScript code to arrange elements to be same with specified HTML or element using jQuery Element Diff

jQuery Element Diff Plugin is a plugin to generate JavaScript code to arrange elements to be same.

Read On 

Generating unique selector with jQuery Selectorator

jQuery Selectorator Plugin is a plugin to generate unique selector from jQuery object.

$('element').getSelector()

Set options.ignore to ignore classes, ids, names:

$('element').getSelector({ ignore: { classes: ['ui-droppable'] } })

Read On 

Twitter Bootstrap theme for RDoc

screen1

I created a RDoc Generator with Bootstrap forked from Hanna Nouveau.

http://ngs.github.io/hanna-bootstrap/

Hanna Bootstrap is available from RubyGems.

gem install hanna-bootstrap

Or git-clone from the repo if you would.

git clone git://github.com/ngs/hanna-bootstrap.git

The templates of this generator are written in HAML, SASS, CoffeeScript.

You can customize your favorite Bootstrap based theme easily. Enjoy!

Using blink(1) as RSpec formatter

I created Ruby library for blink(1) that wraps official blink1-lib C interface.

This video shows runnning RSpec using blink(1) as formatter, shows current status with LED color.

Both are available on RubyGems

gem install rb-blink1
gem install blink1-formatter

GitHub: rb-blink1, blink1-formatter

Evernote SDK for Mac: Async requests and file attachment support

Current HEAD of Evernote SDK for Mac OS X does not support async requests but the iOS SDK does.

So I ported modern Objective-C code (means non-thrift) from the iOS SDK.

ngs/evernote-sdk-mac

This version enables note creation very easy.

Read On