Skip to content

Instantly share code, notes, and snippets.

View PragTob's full-sized avatar

Tobias Pfeiffer PragTob

View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active July 21, 2024 01:20
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
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
@mattwynne
mattwynne / gist:1228927
Created September 20, 2011 11:52
eventually helper method for making assertions against asynchronous systems
# 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
@marcinbunsch
marcinbunsch / codewall.badges.js
Created March 10, 2012 22:18
Coderwall - display missing badges
// 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
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"
@rubiii
rubiii / readme.md
Created July 24, 2012 09:15 — forked from phoet/readme.md
Señor Developer Competition at eurucamp 2012

Ever seen these T-Shirts?

Señor Developer T-Shirt

Want one?

Get one for free at eurucamp!

If you are an attendee of eurucamp 2012, you get the chance to win a FREE Señor Developer t-shirt.

@steveklabnik
steveklabnik / log.txt
Created August 19, 2012 09:59
A fun shell script from #euruku
$ 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
@steveklabnik
steveklabnik / pair
Created November 9, 2012 13:09
A ruby script to change pairs
#!/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}"`
@peterc
peterc / backwards.txt
Created November 26, 2012 23:08
Reading
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/:
@solnic
solnic / rvm_remove_old.sh
Created December 4, 2012 09:34
Remove all rubies older than given date
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
@bf4
bf4 / ruby_learning.md
Last active July 17, 2021 08:06
Some Ruby Learning Resources