List moved
Please use https://github.com/bf4/learning to fork and pull changes.
List moved
Please use https://github.com/bf4/learning to fork and pull changes.
| DATE=2012-06-01 | |
| for version in `find $rvm_path/rubies/ -mindepth 1 -maxdepth 1 -type d -not -newermt $DATE | cut -d / -f 7`; do rvm remove $version; done |
| I'm a Rubyist with a lot of admiration for Python. Both languages are | |
| similar (in the grand scheme of things) and each has huge pros and cons. | |
| Python does not click for me in the same way as Ruby does not | |
| click for perhaps the majority of programmer-kind. German doesn't click | |
| for me either and 100m+ people speak that ;-) But I recently saw an | |
| example of WHY Python taxes my Ruby brain a little. | |
| I found some code at http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/: |
| #!/usr/bin/env ruby | |
| def usage | |
| puts "./pair [name]: pair two people" | |
| puts "./pair : switch to just steve" | |
| exit | |
| end | |
| def set_config(name, email) | |
| `git config user.name "#{name}"` |
| $ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30 | |
| 610 git status | |
| 568 git commit -m | |
| 491 git add . | |
| 252 git push origin | |
| 176 bundle | |
| 138 rails s | |
| 128 ls | |
| 120 git commit --amend | |
| 114 git reset --hard |
| require 'base64' | |
| def public_base64(key) | |
| ["ssh-rsa", Base64.encode64(ssh_public_key_conversion(key)).gsub("\n", "")].join(" ").strip | |
| end | |
| def ssh_public_key_conversion(public_key) | |
| out = [0, 0, 0, 7].pack("C*") | |
| out += "ssh-rsa" |
| // How to use this: | |
| // 1. Go to the desired profile page on coderwall, like http://coderwall.com/marcinbunsch | |
| // 2. Paste this gist in the JS console | |
| // | |
| // You can also probably use this in greasemonkey and dot.js | |
| // | |
| // Also, it was tested in Chrome, Firefox and Safari, it probably will | |
| // not work in IE, but I just don't care about it ;) | |
| // | |
| // UPDATE: Coderwall made changes to the site and I cannot retrieve the achievements, so they are hardcoded, taken from a cached version of the achievements page |
| # usage: | |
| # it "should return a result of 5" do | |
| # eventually { long_running_thing.result.should eq(5) } | |
| # end | |
| module AsyncHelper | |
| def eventually(:options = {}) | |
| timeout = options[:timeout] || 2 | |
| interval = options[:interval] || 0.1 | |
| time_limit = Time.now + timeout | |
| loop do |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |