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 / twin.rb
Created September 10, 2015 09:20
Disposible::Twin.fake
class Disposable
class Twin
def self.fake
types = {}
representer_class.representable_attrs[:definitions].each_pair do |key, value|
types[key] = value.instance_variable_get(:@options)[:type]
end
attributes = {}
puts types
types.each_pair do |key, type|
@timoschilling
timoschilling / rake
Last active August 26, 2015 14:27
demo simple rake
#!/usr/bin/env ruby
require "./rake_lib"
require "./test_task"
exec ARGV.first.to_sym
@timoschilling
timoschilling / client.sh
Created October 14, 2013 14:18
self made ical client/server ;)
telnet 127.0.0.1 1234
@timoschilling
timoschilling / mac.txt
Created April 17, 2013 15:50
set different mac address
sudo ifconfig en1 ether 60:33:4b:0b:50:0e
ifconfig en1 | grep ether
@timoschilling
timoschilling / hlink.rb
Created April 8, 2013 13:54
ruby script to create recrosive hardlinks of files with directory structure
#!/bin/sh
#
# Lives in .git/hooks.
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
exec 1>&2
# works, but is slow. try with ack!
# LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus'
class D
def macro
:referenced_in
end
def foreign_key
"listimage_asset_id"
end
def eager_load ids
[9,8].each.with_index(2).with_object([]).with_index(99){|((a,i1),s),i2| s << [a,i1,i2].join("-")}
@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(':')"`
@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.