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
{ | |
"auction": { | |
"amount": 0, | |
"amount_updated_at": null, | |
"canceled_at": null, | |
"city": null, | |
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
(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 = ""; |
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
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; |
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
*** 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 |
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
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 | |
] |
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
### | |
# 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" |
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
### | |
# 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" |
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
# 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 |
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 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 |
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 Foo | |
has_attached_file :image | |
def image=(image) | |
if super(image) | |
do_stuff_with!(@temp_uploaded_file) | |
end | |
end |