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
window.onload = function(){ | |
navigator.getMedia = (navigator.getUserMedia || | |
navigator.webkitGetUserMedia || | |
navigator.mozGetUserMedia || | |
navigator.msGetUserMedia); | |
(function init(g){ | |
try { | |
Synth.audio.ctx = new (g.AudioContext || g.webkitAudioContext); |
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
worker_processes 4 | |
timeout 30 | |
preload_app true | |
listen 3000 if ENV["RAILS_ENV"] == "development" | |
before_fork do |server, worker| | |
# Replace with MongoDB or whatever | |
if defined?(ActiveRecord::Base) | |
ActiveRecord::Base.connection.disconnect! | |
Rails.logger.info('Disconnected from ActiveRecord') |
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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
* { margin:0; paddding:0; } | |
video { width:100%; height:100%; display:none; } | |
</style> | |
</head> | |
<body> | |
<video id="video" poster="http://content.bitsontherun.com/thumbs/q1fx20VZ-720.jpg" preload="none"> |
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 'factory_girl' | |
namespace :db do | |
desc "Populate the database with some sample data" | |
task :populate, [:count] => [:environment] do |t, args| | |
args.with_defaults(:count => 10) | |
puts "Resetting the database" | |
Rake::Task['db:reset'].invoke | |
puts "Creating #{args[:count]} users" | |
new_users = FactoryGirl.create_list(:user, args[:count].to_i) |
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
# Picture factory definition | |
FactoryGirl.define do | |
factory :picture do | |
image { File.open(Dir.glob(File.join(Rails.root) + "/spec/support/pictures/*").sample) } | |
end | |
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
FactoryGirl.define do | |
factory :picture do | |
image { File.open(File.join(Rails.root, 'spec', 'support', 'pictures', 'spec.png')) } | |
end | |
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
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js"></script> | |
<script> | |
var events = []; | |
// event constructor | |
function CalendarEvent(name, permalink, lat, lon, description, start_date, start_time, id){ | |
this.name = name; | |
this.permalink = permalink; | |
this.lat = lat; |
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
avg := Object clone | |
avg myAverage := method(l, | |
for(i, 0, l size, if (l at(i) type != "Number", "not a number" println return)) | |
if (l type == "List", if(l size > 0, l average, "blank list"), "not a list")) | |
avg myAverage(list(1, 2, "three")) println |
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
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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
export PROMPT_COMMAND="history -a" | |
#rds | |
export AWS_RDS_HOME=~/.rds | |
export PATH=$PATH:$AWS_RDS_HOME/bin | |
#ec 2 | |
export EC2_HOME=~/.ec2 | |
export PATH=$PATH:$EC2_HOME/bin | |
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem` |
NewerOlder