Skip to content

Instantly share code, notes, and snippets.

View terrafied's full-sized avatar
💭
Shopping for cute shoes

Terra Metta terrafied

💭
Shopping for cute shoes
  • The Trans Agenda
  • 62 West Wallaby St., The Shire
View GitHub Profile
module Randomizer
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def some(num = 5)
find :all, :order => 'random()', :offset => (count * rand).to_i, :limit => num
end
module Randomizer
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def some(num = 5)
find :all, :order => 'random()', :offset => (count * rand).to_i, :limit => num
end
Veewee::Session.declare( {
:cpu_count => '1',
:memory_size=> '512',
:disk_size => '10140',
:disk_format => 'VDI',
:disk_size => '10240' ,
:os_type_id => 'Ubuntu',
:iso_file => "ubuntu-10.04.1-server-i386.iso",
:iso_src => "http://releases.ubuntu.com/10.04.1/ubuntu-10.04.1-server-i386.iso",
:iso_md5 => "01f72c846845e4e19aec8a45912e5dda",
@terrafied
terrafied / Multiple Rubies
Created January 29, 2011 17:14
veewee error with RVM
boudica:veewee john$ rvm rake build['mettabox'] --trace
build[mettabox] --trace
rvm 1.1.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
isofile ubuntu-10.04.1-server-amd64.iso is available
["6336b3f6e6dfb69cf8dca4be7781f709", "30b5c6fdddbfe7b397fe506400be698d"]
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
By ERRIN HAINES
The Associated Press
Tuesday, March 1, 2011; 6:58 PM
ATLANTA -- Georgia is the latest state to propose legislation that questions whether President Barack Obama was born in the U.S., joining 10 other states who have measures that want more proof before his name is put on the 2012 ballot.
Even though Hawaii officials have repeatedly confirmed Obama's citizenship, his birth certificate has been made public and courts have rebuffed challenges, the so-called "birther" issue hasn't gone away.
Georgia Rep. Mark Hatfield, a Republican, said he still doesn't know if Obama is eligible to serve as president, and 92 of his GOP colleagues and one Democrat support the bill introduced Monday.
'''
Created on Feb 2, 2011
@author: john
'''
import sqlite3
import scipy
import random
#Input: (time, lat, lon, a, b, c,)
@terrafied
terrafied / production
Created March 7, 2011 16:18
production-ssl
<VirtualHost *:80>
RedirectMatch /sti_offset_air(.*)$ https://64.79.208.238/sti_offset_air$1
ServerAdmin info@sustainabletravel.com
DocumentRoot /var/www/production
ServerName sustainabletravelinternational.org
ServerAlias chinook.sustainabletravelinternational.org www.sustainabletravelinternational.org sustainabletravel.com chinook.sustainabletravel.com
<Directory /var/www/production>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
@terrafied
terrafied / deploy.rb
Created March 11, 2011 20:47
deploy.rb
#!/usr/local/bin/ruby
if ARGV.length < 2
raise "Must have a path and a deployment name (i.e. deploy.rb /path/to/app theappname)"
end
p "Deploying for #{ARGV.join(",")}"
def listdir path
dirs = Dir.entries(path)
@terrafied
terrafied / randomizer.rb
Created April 5, 2011 10:44
Return random records from a Rails model
module Randomizer
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def some(num = 5)
find :all, :order => 'rand()', :offset => (count * rand).to_i, :limit => num
end