Skip to content

Instantly share code, notes, and snippets.

View adrianpike's full-sized avatar

Adrian Pike adrianpike

View GitHub Profile
# in scruffy we trust.
# NNNmmmNmmmmmmmmmMmMddmdmh+oooooooooooooooooooooooooooooooooooooooooooooooooooooo
# mmmNNNNmmmmmmmmmNmMdmmdmh+oooooooooooooooooooooooooooooooooooooooooooooooooooooo
# mmmmmNMNmmmmmmmmNmMdddmdd+ooooooooooo++oooooooooooo+++oooooooooooooooooooooooooo
# mmmmmmNmNNNmmmmmNmMddmdmd+ooooooooooshyhhhhyhhhyhhhhhyssoo+ooooooooooooooooooooo
# mmmmmmNmmmNNNmmmMmMddmdmh+oooooooo+hhyyyyyyyyyyyyyyyyyyyhhysoo+ooooooooooooooooo
# mmmmmmNmmmmmmNNNMmNdddmmh+ooooooo+hyyyyyyyyyyyyyyyyyyyyyyyyyhhyso+oooooooooooooo
# NmmmmmNmmmmmmmmmMmNddddmh+ooooooo+dsyyyyyyyyyyyyyyyyyyyyyyyyyyyhhho+oooooooooooo
# mNNNmmNmmmmmmmmmmmNmmmmmh+o++oooosmhhhyyyyyyyyyyyyyyyyyyyyyyyyyyyyhho+oooooooooo
# mmmmNNNmNdhyyyyyyyyyyhhhhhhyysoyhhyyyyyyyyyyyyyyhhhhhhyyyyyyyyyyyyyyds+ooooooooo
@adrianpike
adrianpike / gist:787267
Created January 20, 2011 01:54
acts_as_archive examples
class Event < ActiveRecord::Base
acts_as_archive :quick => true
belongs_to :asset
belongs_to :user
has_many :invitations, :dependent => :destroy
has_many :users, :through => :invitations
ruby-1.9.2-p0 > Event::Archive.reflect_on_all_associations
=> []
ruby-1.9.2-p0 > Event.reflect_on_all_associations
=> [#<ActiveRecord::Reflection::AssociationReflection:0x0000010329a0f0 @macro=:belongs_to, @name=:asset, @options={}, @active_record=Event(id: integer, type: string, asset_id: integer, user_id: integer, title: string, description: text, start: datetime, stop: datetime, reoccurrence_id: integer, exclusive: boolean, organizer_notes: text, guest_notes: text, location: string, created_at: datetime, updated_at: datetime, schedule_type: text, completed_at: datetime), @collection=false>, #<ActiveRecord::Reflection::AssociationReflection:0x0000010306c210 @macro=:belongs_to, @name=:user, @options={}, @active_record=Event(id: integer, type: string, asset_id: integer, user_id: integer, title: string, description: text, start: datetime, stop: datetime, reoccurrence_id: integer, exclusive: boolean, organizer_notes: text, guest_notes: text, location: string, created_at: datetime, updated_at: datetime, sched
@adrianpike
adrianpike / unicorn_kicker.rb
Created February 8, 2011 16:32
unicorn kicker cap task
task :kick, :roles => :app do
pidfile = "#{shared_path}/pids/unicorn.pid"
p pidfile
run("test -f #{pidfile} && cat #{pidfile} || echo 0") do |ch,stream,data|
pid = data.to_i
if pid>0 then
puts "Telling Unicorn #{pid} to go away..."
sudo("kill -USR2 #{pid}")
@adrianpike
adrianpike / gist:1073008
Created July 8, 2011 22:47
Blueprint errors
[apps@ip-10-195-219-4 ~]$ sudo blueprint create app
audit_log_user_command(): Connection refused
# [blueprint] using cached blueprintignore rules
# [blueprint] searching for PEAR/PECL packages
# [blueprint] searching for Ruby gems
# [blueprint] searching for configuration files
# [blueprint] searching for software built from source
# [blueprint] searching for APT packages
# [blueprint] searching for Python packages
# [blueprint] searching for Yum packages
minecraft base:
(1064,425)
|
|
| <-- bridge
|
|
|
|
@adrianpike
adrianpike / aegisco.repo
Created August 11, 2011 20:41
aegisco repo
[aegisco]
name=AegisCo rhel$releasever repo - $basearch
baseurl=http://rpm.aegisco.com/aegisco/rhel/5/$basearch
enabled=1
priority=5
gpgcheck=1
gpgkey=http://rpm.aegisco.com/aegisco/RPM-GPG-KEY-aegisco
[aegisco-debuginfo]
name=AegisCo rhel$releasever repo - $basearch - Debug
def BadAssController
def new
@badass = BadAss.new({
:title => 'AMAZING DEFAULTS'
})
end
Hey all,
With the announcement that the official rumble is going to happen a little later than expected, we've been discussing the idea of holding a smaller Rails app event - sort of an "exhibition match", if you will.
We're still in the early discussion/feasibility stage, but here's a few things we've been throwing around:
- It would be independent but complementary to the Rumble - our goal would be to supplement, rather than replace.
- We'd like to keep competitor numbers down & quality up - either by invitation or pre-screened by panel
- Competition would be only 24 hours, so Sunday can be for sleepin'.
- There would be required peer judging - every competitor would have to use & rate everybody else's apps. We'd want to keep all the numbers & votes public and open. The original hope was to somehow make it completely decentralized, but I'm thinking there would still have to be one or two benevolent dictators to keep things moving.
ssh -R 5050:10.80.74.236:22 [email protected]