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
source "http://gems.github.com" | |
source "http://gemcutter.org" | |
bundle_path "gems" | |
gem "dm-core" | |
gem "dm-migrations" | |
gem "dm-sweatshop" | |
gem "data_objects" | |
gem "do_postgres" |
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
# Use this to look for broken links in your app. | |
# crawls the development server http://localhost:3000 | |
# Suggestion: Also check to make sure that intentional 404s | |
# are handled gracefully by app. | |
task :crawl => :environment do | |
require 'anemone' | |
root = 'http://localhost:3000' | |
options = {:discard_page_bodies => true, :verbose => true} |
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
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux] | |
curb (0.6.2.1) | |
em-http-request (0.2.5) | |
eventmachine (0.12.10) | |
typhoeus (0.1.13) | |
user system total real Memory (Kb) | |
4kb std | |
0.000000 0.000000 3.010000 ( 22.408594) 24,484 |
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
# Config for Nginx to act as a front-end for Riak | |
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc) | |
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_) | |
# Config is in /etc/nginx/sites-available/default or somewhere like that | |
# Set up load-balancing to send requests to all nodes in the Riak cluster | |
# Replace these IPs/ports with the locations of your Riak nodes | |
upstream riak_hosts { | |
server 127.0.0.1:8098; |
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 | |
require 'pg' | |
require 'stringio' | |
$stderr.puts "Opening database connection ..." | |
conn = PGconn.connect( :dbname => 'test' ) | |
conn.exec( <<END_SQL ) | |
DROP TABLE IF EXISTS logs; |
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/bash | |
function flask-boilerplate-tmux | |
{ | |
# https://github.com/swaroopch/flask-boilerplate | |
BASE="$HOME/code/flask-boilerplate" | |
cd $BASE | |
tmux start-server | |
tmux new-session -d -s flaskboilerplate -n model |
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 'gserver' | |
class ChatServer < GServer | |
def initialize *args | |
super | |
#Keep a list for broadcasting messages | |
@chatters = [] | |
#We'll need this for thread safety |
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
def is_ajax_request? | |
if respond_to? :content_type | |
if request.xhr? | |
true | |
else | |
false | |
end | |
else | |
false | |
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
# <%= google_analytics 'UA-XXXXXX-XX' %> | |
# </body> | |
# application_helper.rb | |
module ApplicationHelper | |
def google_analytics(id) | |
content_tag :script, :type => 'text/javascript' do | |
"var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', '#{id}']); |
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
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
OlderNewer