- Open Source Cloud – compute nodes and object storage
- openstack-cookbooks – stable ([email protected]/opscode.org)
- dellcloudedge – bare metal openstack installer
- voxeldotnet – cookbooks for launching swift in production with spiceweasel
This file contains hidden or 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
# Unfortunately the Rails 2 version of DJ doesn't support before/after hooks. This hacks those in | |
# Stick this in an initalizer, and then any before(job) and after(job) methods in your Job classes will get called | |
module Delayed | |
module Backend | |
module ActiveRecord | |
class Job < ::ActiveRecord::Base | |
def invoke_job | |
payload_object.before(self) if payload_object.respond_to?('before') | |
payload_object.perform |
This file contains hidden or 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 'fog' | |
desc "Tell us how much space is in use on S3" | |
namespace :s3 do | |
task usage: :environment do | |
size = 0 | |
connection = Fog::Storage.new( | |
provider: 'AWS', | |
aws_access_key_id: ENV['aws_access_key_id'], |
This file contains hidden or 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
# This and the next method are unfortunately 'magic' | |
# They set default paramaters for these two find_or_create_by_ method_missing methods | |
def self.find_or_create_by_email(params) | |
params = { email: params } unless params.is_a?(Hash) | |
super(params.reverse_merge( | |
password: Digest::MD5.hexdigest("#{rand(1024)}Time.now"), | |
username: Digest::MD5.hexdigest("#{rand(1024)}Time.now") | |
)) | |
end | |
This file contains hidden or 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
test "getters/setters for shipping methods should work" do | |
listing = Factory.create(:listing) | |
assert !listing.shipping_methods.include?('CATBUS') | |
assert !listing.ship_via_catbus | |
listing.ship_via_catbus = true | |
assert listing.ship_via_catbus | |
assert listing.shipping_methods.include?('CATBUS') | |
listing.ship_via_catbus = false | |
assert !listing.ship_via_catbus | |
end |
This file contains hidden or 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
web: bundle exec rails server thin -p $PORT | |
worker: bundle exec rake jobs:work | |
memcached: bundle exec memcached -m 64 | |
solr: bundle exec rake sunspot:solr:run |
This file contains hidden or 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
gem 'fog' # Storage on S3 for carrierwave | |
gem 'rmagick' # Resizes images and makes thumbnails | |
gem 'carrierwave' # Image attachments, newer version doesn't work with local files preview hack | |
gem 'asset_sync' # Syncs assets to S3 |
This file contains hidden or 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
import heatmap # http://jjguy.com/heatmap/ | |
import random | |
import csv | |
if __name__ == "__main__": | |
pts = [] | |
for point in csv.reader(open('coords.csv')): | |
pts.append((float(point[0]), float(point[1]))) | |
print "Processing %d points..." % len(pts) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 10 columns, instead of 7 in line 6.
This file contains hidden or 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
Dwarf Fortress,Dwarf Fortress,Dwarf Fortress,Dwarf Fortress,Dwarf Fortress,Dwarf Fortress,Tabletop RPGs,Dwarf Fortress,Dwarf Fortress,Dwarf Fortress | |
Pokemon,Star Wars,Ardiuno,Eclipse,Xcode,Android,Nerd Ranches,Bill Gates,Steve Balmer,Aaron Hillegass | |
Nethack,Dungeons and Dragons,MUDs,LARPing,Calculator watches,Comics,CCGs,MMORPGs,Lightning bolt! Lightning bolt!,There are only 10 types of people... | |
Nerdiest Things Of All Time Surverys,LARP,Dungeons and Dragons,Coding for Commodore 64,Programming your own TI-82 Games,Cosplay,John Carmack,Steve Wosniak,Misfired High Five,Short sleeved plaid shirts | |
Magic,Astronomy,Mathematics,Physics,Science Fiction,Electronics,Computers,Programming,Philosophy,Woodworking | |
Singh's Mac OS X Internals book,Fountain pens,Molecular gastronomy,Indo-European poetics,Derridean post-structuralism,New Hacker's Dictionary / The Jargon File,Hacker's Delight,Napier's bones,Proust,Medieval alchemical manuscripts | |
LARPing,Whirlyball Bachelor Parties,FaerieCon,Reenactments,Code Golf,Pale Skin,Coll |
This file contains hidden or 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
<?php | |
$config = array( | |
'db_host' => 'localhost', | |
'db_user' => 'root', | |
'db_pass' => '', | |
'system_name' => `hostname`, | |
'send_mail' => TRUE, // TRUE to send e-mails, FALSE to operate silently | |
'mail_to' => 'root@localhost', // comma-separated list of e-mail addresses |