Skip to content

Instantly share code, notes, and snippets.

View adrianpike's full-sized avatar

Adrian Pike adrianpike

View GitHub Profile
@adrianpike
adrianpike / scrapie.rb
Created October 26, 2011 18:48
Scrapie Idea
# Scrapie
class Airplane < Scrapie
url 'http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx'
params {
:n_number => 'NNumbertxt'
}
attributes {
'serial_number' => 'div#serial_number',
'classname' => '.class_name'
}
@adrianpike
adrianpike / to_select_tag_shenanigannery.rb
Created October 25, 2011 23:48
arr, there be tomfoolery afoot with to_select_tag - relevant: 7f64e472
# Hokay, we go from this bad boy here:
@badass_kinds = {
'Number' => 'number',
'Text' => 'text',
'Yes/No' => 'boolean'
}
# And utilize it in delicious fashion like so, with formtastic:
<%= semantic_form_for([@asset.becomes(Asset), @channel]) do |f| %>
<%=f.inputs do %>
(use http-client)
(use html-parser)
(use sxpath)
(define yuno "http://memegenerator.net/Y-U-No/caption/166088")
(define doc (with-input-from-request yuno
'((generatorID . "2")
(imageID . "166088")
(watermarkCode . "")
ssh -R 5050:10.80.74.236:22 [email protected]
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.
def BadAssController
def new
@badass = BadAss.new({
:title => 'AMAZING DEFAULTS'
})
end
@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
minecraft base:
(1064,425)
|
|
| <-- bridge
|
|
|
|
@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
@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}")