Skip to content

Instantly share code, notes, and snippets.

View timoschilling's full-sized avatar
👻
yolo

Timo Schilling timoschilling

👻
yolo
View GitHub Profile
@timoschilling
timoschilling / FritzBox_iPhone_VPN_Setup.txt
Created November 1, 2010 13:39
Example of a FritzBox <-> iPhone VPN Setup
vpncfg {
connections {
enabled = yes;
conn_type = conntype_user;
name = "iPhone";
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
@timoschilling
timoschilling / jquery_dom_load.js
Created March 2, 2011 01:36
jQuery snippet that simulates the DOM building via https://twitter.com/jquery/status/42756061685497856
jQuery(function($) {
(function n(e){
e.eq(0).fadeIn(99,
function(){
n(e.slice(1))
}
)}
)($(":visible").hide())
})
@timoschilling
timoschilling / aliases.sh
Created May 12, 2011 12:15
my bash aliases
alias l='ls -la'
alias ..='cd ..'
alias r='rails'
alias rs='rails server'
alias rc='rails console'
alias pubkey='cat .ssh/id_rsa.pub | pbcopy'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
export PS1="\[\e[0m\]\w\[\e[0m\]\$(parse_git_branch) \$ "
@timoschilling
timoschilling / .tm_properties
Created April 28, 2012 15:02
textmate config
#http://wiki.macromates.com/Reference/Settings
fontSize = 12
fontName = Monaco
showInvisibles = true
spellChecking= true
excludeInFileChooser = "{$exclude,public/uploads/assets,\.git,\.sass-cache/}"
windowTitle = "$TM_DISPLAYNAME${TM_DIRECTORY/\A(?:\/Users\/captainhagbard\w+\/?(.*)|(.+))\z/${2:? – ${2/\A\/Users\/captainhagbard/~/}:${1/\A(?=.)/ – /}}/}"
@timoschilling
timoschilling / nrt2tokyo.rb
Created June 20, 2012 09:35 — forked from melborne/nrt2tokyo.rb
Solve optimal path from Narita to Tokyo with inject
class OptimalPath
def initialize(road_system)
@road_system = road_system
end
def solve
bestA, bestB =
@road_system.inject([Path.new, Path.new]) do |(pathA, pathB), section|
road_step(pathA, pathB, section)
end
sort $HISTFILE | uniq -c | sort -k1 -rn | head -n 30
@timoschilling
timoschilling / .gitignore
Created November 7, 2012 16:10
Representable speed test app
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
@timoschilling
timoschilling / gist:4082060
Created November 15, 2012 22:49
create random mac addresses
sudo ifconfig en0 ether `ruby -e "puts '00:'+(1..5).map{rand(128).to_s(16)}.join(':')"`
[9,8].each.with_index(2).with_object([]).with_index(99){|((a,i1),s),i2| s << [a,i1,i2].join("-")}