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
#!/usr/bin/env ruby | |
# A quick script to download all your files from CloudApp. | |
# To run this just run the script passing your e-mail & password | |
# to the script, for example: | |
# | |
# gem install cloudapp_api | |
# ruby cloudapp-export.rb [email protected] mypassword | |
# |
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
@import url('normalize.css'); |
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> | |
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 ie7" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9 ie8" lang="en"> <![endif]--> | |
<!--[if IE 9 ]> <html class="no-js lt-ie10 ie9" lang="en"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> |
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 _form_valid = false; | |
$("form").submit(function(e) { | |
var self = this; | |
if(!_form_valid) { | |
e.preventDefault(); | |
$.ajax({ | |
'url' : 'http://where.com', | |
'dataType' : 'post', | |
'success' : function() { | |
self.submit(); |
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
#!upstart | |
description "redis" | |
start on runlevel [23] | |
script | |
export HOME="/home/rails" | |
exec sudo -u rails /usr/bin/redis-server /etc/redis.conf | |
end script |
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
# Heroku S3 Database backup task | |
# by Nick Merwin (Lemur Heavy Industries) 10.08.09 | |
# * dumps db to yaml, gzip's and sends to S3 | |
# | |
# Setup: | |
# 1) replace APP_NAME and BACKUP_BUCKET with your info | |
# 2) add config/s3.yml like so (same as Paperclip's): | |
# production: | |
# access_key_id: ... | |
# secret_access_key: ... |
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
#!/bin/sh | |
# Modified from http://onrails.org/articles/2007/11/03/installing-rmagick-on-leopard-without-macports-or-fink | |
curl -O http://mirror.its.uidaho.edu/pub/savannah/freetype/freetype-2.3.9.tar.gz | |
tar xzvf freetype-2.3.9.tar.gz | |
cd freetype-2.3.9 | |
./configure --prefix=/usr/local | |
make | |
sudo make install |
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 Test::Unit::TestCase | |
def self.should_validate_associated(*associations) | |
klass = self.name.gsub(/Test$/, '').constantize | |
context "#{klass}" do | |
associations.each do |association| | |
should "validate #{association} association" do | |
assert klass.new.respond_to?("validate_associated_records_for_#{association}") | |
end | |
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
# The macro | |
class Test::Unit::TestCase | |
def self.should_be_in_state(state) | |
klass = self.name.gsub(/Test$/, '').constantize | |
context "#{klass}" do | |
should "be #{state}" do | |
assert_equal klass.new.state_name.to_s, state.to_s | |
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
# /etc/hosts on OSX | |
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 www.twitter.com | |
127.0.0.1 twitter.com |
NewerOlder