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 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| |
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
#!/usr/bin/env ruby | |
require "./rake_lib" | |
require "./test_task" | |
exec ARGV.first.to_sym |
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
telnet 127.0.0.1 1234 |
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
sudo ifconfig en1 ether 60:33:4b:0b:50:0e | |
ifconfig en1 | grep ether |
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/ruby | |
require "fileutils" | |
src = ARGV.first | |
dest = ARGV.last | |
Dir.chdir(src) do | |
src_dirs = Dir["**/*/"].select{|node| !File.file? node } | |
src_files = Dir["**/*"].select{|node| File.file? node } |
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/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' |
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 D | |
def macro | |
:referenced_in | |
end | |
def foreign_key | |
"listimage_asset_id" | |
end | |
def eager_load ids |
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
[9,8].each.with_index(2).with_object([]).with_index(99){|((a,i1),s),i2| s << [a,i1,i2].join("-")} |
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
sudo ifconfig en0 ether `ruby -e "puts '00:'+(1..5).map{rand(128).to_s(16)}.join(':')"` |
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
# 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. |