This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://stackoverflow.com/questions/894860/set-a-default-parameter-value-for-a-javascript-function | |
| function foo(a, b) | |
| { | |
| a = typeof a !== 'undefined' ? a : 42; | |
| b = typeof b !== 'undefined' ? b : 'default_b'; | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://hocuspokus.net/2009/07/add-git-and-svn-branch-to-bash-prompt/ and http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/ | |
| parse_git_branch () { | |
| #git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git::\1)#' | |
| #git branch 2> /dev/null | grep "" | sed -e 's/*//g' | |
| #git branch 2> /dev/null| sed -n '(^\*/s/^\* //p' | |
| ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
| echo " (git::"${ref#refs/heads/}")" | |
| } | |
| # detect whether any changesets are stashed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chris@local:/Users/chris:rvm get head | |
| Original installed RVM version: | |
| rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/] | |
| remote: Counting objects: 371, done. | |
| remote: Compressing objects: 100% (291/291), done. | |
| remote: Total 371 (delta 51), reused 190 (delta 34) | |
| Receiving objects: 100% (371/371), 860.58 KiB, done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # question regarding http://blog.steveklabnik.com/2011/12/20/write-better-cukes-with-the-rel-attribute.html | |
| # | |
| When /^I choose to edit the article "([^"]*)"$/ do |article_name| | |
| article = Article.find_by_name(article_name) | |
| find("//a[@href='#{edit_article_path article}']").click | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| str = javascript_include_tag '/vendor/javascripts/jquery/jquery-1.6.1.js' | |
| str += "\n" | |
| str += javascript_include_tag '/vendor/javascripts/jquery-ujs/rails.js' | |
| str += "\n" | |
| str += javascript_include_tag '/vendor/javascripts/jquery-ui/jquery-ui-1.8.13.custom.min.js' | |
| str += "\n" | |
| str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chris@local:/Users/chris/foo:bundle check | |
| The Gemfile's dependencies are satisfied | |
| chris@local:/Users/chris/foo:rails s | |
| /Users/chris/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems.rb:900:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError) | |
| from /Users/chris/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in `activate' | |
| from /Users/chris/.rvm/rubies/ruby-1.9.2-head/lib/ruby/site_ruby/1.9.1/rubygems.rb:1276:in `gem' | |
| from /Users/chris/.rvm/gems/ruby-1.9.2-head@foo/bin/rails:18:in `<main>' | |
| chris@local:/Users/chris/foo: |
NewerOlder