Skip to content

Instantly share code, notes, and snippets.

View justincampbell's full-sized avatar
🌯
🍩

Justin Campbell justincampbell

🌯
🍩
View GitHub Profile
@catsby
catsby / ascii
Created November 13, 2012 17:14
ASCII art for science
(ノ^_^)ノ
(╯°□°)╯︵ ┻━┻
(ノಠ益ಠ)ノ彡┻━┻
(╯°□°)╯︵ sıɥʇ
┬─┬ノ( º _ ºノ)
(╯°□°)╯︵ ╯(.□.╯)
(╯°□°)╯/(.□. \)
ಠ_ಠ
ಠ益ಠ
¯\_(ツ)_/¯
@jimweirich
jimweirich / rock.rb
Created November 9, 2012 23:04
Ruby in Flight - Rock the Cradle
require 'argus'
# Video at: http://youtu.be/6V7hTH35xWw
drone = Argus::Drone.new
drone.start
drone.take_off
sleep 5
2.times do
drone.left(0.3)
@steveklabnik
steveklabnik / reading.md
Last active August 16, 2024 08:03
intro to continental philosophy reading list (french post-structuralism, etc)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@judofyr
judofyr / fizzbuzz.rb
Created August 1, 2012 21:37 — forked from JEG2/fizzbuzz.rb
Writing FizzBuzz with flip-flops
a=b=c=(1..100).each do |num|
print num, ?\r,
("Fizz" unless (a = !a) .. (a = !a)),
("Buzz" unless (b = !b) ... !((c = !c) .. (c = !c))),
?\n
end
@neilberget
neilberget / Rakefile
Created May 10, 2012 00:16
[EXPERIMENTAL] A ruby method that looks for all accessibility labels in all the xib files in the resources directory of a RubyMotion project, create auto-incrementing tags for those elements, and create a ruby file mapping constants named after the labels
task :labels do
require './xib_labels'
XibLabels.process
end
@panthomakos
panthomakos / benchmark.rb
Created May 3, 2012 20:06
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@justincampbell
justincampbell / PhillyETE 2012 Day 1.md
Created April 10, 2012 21:08
PhillyETE 2012 Notes

todo

Storm Threequal js vs ruby

Keynote

The E myth Org chart for yourself

QFD = ideas into actionable items

# table_stats User
# table_stats User, :email, :name
def table_stats(model, *fields)
old_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
fields = model.send :column_names if fields.empty?
model_count = model.send(:count)