This file contains 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
# in case there is no first commit | |
svn co $SVN_PATH | |
svn add . | |
svn commit | |
# now the git-svn part | |
git svn init $SVN_PATH | |
git svn fetch | |
# commit from git |
This file contains 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
# please only interesting methods! | |
class Object | |
# return only the methods not present on basic objects | |
def interesting_methods | |
(self.methods - Object.new.methods).sort | |
end | |
end |
This file contains 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
def quick_benchmark(repetitions=100, &block) | |
require 'benchmark' | |
Benchmark.bmbm do |b| | |
b.report {repetitions.times &block} | |
end | |
nil | |
end |
This file contains 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
*.aux | |
*.glo | |
*.idx | |
*.log | |
*.toc | |
*.ist | |
*.acn | |
*.acr | |
*.alg | |
*.bbl |
This file contains 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
git add -u |
This file contains 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
#!/bin/bash | |
echo "===================================================================" | |
echo "This bash script will upload tomato.trx in the current directory to" | |
echo "192.168.11.1 during the router's bootup." | |
echo | |
echo "* Set your ethernet card's settings to:" | |
echo " IP: 192.168.11.2" | |
echo " Mask: 255.255.255.0" | |
echo " Gateway: 192.168.11.1." |
This file contains 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
# Chained comparisons in Ruby | |
# inspired by http://coffeescript.org/#comparisons | |
# as well as http://refactormycode.com/codes/1284 | |
[:<, :>, :<=, :>=].each do |operator| | |
[Float, Fixnum, Rational, Comparable].each do |klass| | |
klass.class_eval do | |
alias_method "_#{operator}", operator | |
define_method operator do |rhs| | |
send("_#{operator}", rhs) && rhs |
This file contains 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
# your other stuff… | |
# set ZSH_THEME above this line! | |
# TODO: remove this when bug is fixed in oh-my-zsh | |
# Workaround for loading theme from $ZSH_CUSTOM | |
# Github issue: https://github.com/robbyrussell/oh-my-zsh/pull/1107 | |
MY_ZSH_THEME=$ZSH_THEME; ZSH_THEME='' | |
# OH MY ZSH! |
This file contains 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
ffmpeg -i INFILE -r 25 -f mpeg -vcodec mpeg1video -ar 48000 -b 1500k -acodec mp2 -ar 44100 -ac 1 -y OUTFILE.mpg |
This file contains 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
class Fixnum | |
def each_bit | |
8.times do |p| | |
yield (self & 1 << p) >> p | |
end | |
end | |
end |