This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo '✏ ' | |
| } | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | grep \* | awk '{print $2}' | |
| } | |
| function parse_hg_branch { | |
| hg branch 2>/dev/null |
The new rake task assets:clean removes precompiled assets. [fxn]
Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
These are some of my (Ryan Bates) favorite gems to use for various tasks:
| tell application "Safari" | |
| set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1 | |
| set _name to name of document 1 | |
| end tell | |
| tell application "BBEdit" | |
| make new text window with properties ¬ | |
| {contents:_source, source language:"HTML", name:"Generated source: " & _name} | |
| select insertion point before character 1 of text window 1 |
| #!/usr/bin/env ruby | |
| # figure out which repository this is | |
| # assumes it's a bare repository | |
| repository = /([^\/]*?)\.git$/.match(`pwd`.chomp)[1] | |
| # get the stdins from git | |
| stdins = []; stdins << $_ while gets | |
| stdins.each do |str| |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |