Skip to content

Instantly share code, notes, and snippets.

@ohokay
ohokay / cloudapp-export.rb
Last active September 7, 2018 11:19 — forked from adamcooke/cloudapp-export.rb
Apparently the cloud app api returns a date object, so it needs to be converted to a string.
#!/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
#
@import url('normalize.css');
@ohokay
ohokay / index.html
Created August 22, 2012 16:45
base html
<!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>
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();
#!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
# 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: ...
#!/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
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
# 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
# /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