Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
import praw # simple interface to the reddit API, also handles rate limiting of requests | |
import re | |
from collections import deque | |
from time import sleep | |
USERNAME = "Your username here" | |
PASSWORD = "Your password here" | |
USERAGENT = "Your useragent string here. It should include your /u/username as a courtesy to reddit" | |
r = praw.Reddit(USERAGENT) |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.19370138645172119</real> | |
<key>Green Component</key> | |
<real>0.15575926005840302</real> |
#!/usr/bin/env node | |
// Simply publish a message to a direct exchange. | |
sys = require('sys'); | |
amqp = require('./amqp'); | |
inspect = sys.inspect; | |
puts = sys.puts; | |
connection = amqp.createConnection(); |
#!/bin/sh | |
if [ $# -ne 2 ] | |
then | |
echo "Usage: $0 <postgresql sql dump> <db_name>" >&2 | |
exit 1 | |
fi | |
db_file=$1 | |
db_name=$2 |
#!/bin/bash | |
BACKUP_DIR="~/db_backups" | |
DBUSER="" | |
DBPASSWORD="" | |
BUCKET="" | |
FROM='"Backups" <backups@localhost>' | |
TO='"Admin" <admin@localhost>' | |
SUBJECT='Backup Log' |
#!/bin/bash | |
USER="" | |
PASSWORD="" | |
if [ -z $1 ]; then | |
echo -e "ERROR: No database name. Usage: export_db DATABASE_NAME" | |
exit; | |
fi | |
DB=$1 |
require 'rubygems' | |
require 'aws/s3' | |
# Change the access key and secret to your amazon credentials | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'ACCESS_KEY_ID', | |
:secret_access_key => 'SECRET' | |
) | |
# Change this to your S3 bucket name | |
WEBSITE_BUCKET_NAME = "YOUR_BUCKET_NAME" |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |