Skip to content

Instantly share code, notes, and snippets.

View nz's full-sized avatar

Nick Zadrozny nz

View GitHub Profile
{
"auction": {
"amount": 0,
"amount_updated_at": null,
"canceled_at": null,
"city": null,
(function($){
$(document).ready(function() {
////////Global Variables//////
$callFinished = false;
$run = false;
window.twitter = [];
$totalAPICalls = 1;
$totalToDisplay = 5;//total tweets to show
$.fn.reverse = [].reverse;
window.url = "";
var growthFactor = function(totalTweets) {
var lowerBoundTweets = 100;
var lowerBoundGrowth = 1;
var upperBoundTweets = 200;
var upperBoundGrowth = 1.5;
var dx = upperBoundTweets - lowerBoundTweets;
var dy = upperBoundGrowth - lowerBoundGrowth;
*** Listing cloud auth
****** Active instances
i-e9db8880 174.129.85.138
*** Listing cloud dbmaster
****** Active instances
i-e9db8880 174.129.85.138
*** Listing cloud dbslave
****** Active instances
i-e9db8880 174.129.85.138
*** Listing cloud app
require 'rubygems'
require 'grit'
ddp = Grit::Repo.new("/Users/nick/Sites/ddp")
ddp.commits('qualcomm', 100).select{ |commit| commit.author.name =~ /Zadrozny/ }.each do |commit|
puts "%s - %s - %s" % [
commit.date.strftime('%a, %d %b, %H:%m'),
commit.id_abbrev,
commit.short_message
]
###
# Install and configure Ruby Enterprise Edition
##
# TODO: Replace kludgy shell tests with not_if
# TODO: Use better resources than bash scripts (i.e., remote_file)
version = "1.8.6-20090610" # TODO: move to an attribute file
package "libreadline5-dev"
###
# Install and configure Ruby Enterprise Edition
##
# TODO: A future release of Chef should have a source_package resource to handle installs like this
version = "1.8.6-20090610" # TODO: move to an attribute
package "libreadline5-dev"
package "libssl-dev"
# Before
execute "git clone --depth 1 git://github.com/actionrails/modporter.git modporter" do
cwd "/tmp"
not_if "test -f /etc/apache2/mods-enabled/porter.load"
end
execute "perl -p -i -e 's/\"apxs\"/\"apxs2\"/g' Rakefile" do
cwd "/tmp/modporter"
not_if "test -f /etc/apache2/mods-enabled/porter.load"
end
execute "rake" do
class Thing < ActiveRecord::Base
has_many :other_things, :select => OtherThing.columns_to_select.join(",")
end
class OtherThing < ActiveRecord::Base
belongs_to :thing
def self.columns_to_select
column_names - ["big_column_1", "big_column_2"]
end
class Foo
has_attached_file :image
def image=(image)
if super(image)
do_stuff_with!(@temp_uploaded_file)
end
end