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
$:.unshift File.join(File.dirname(__FILE__), *%w[lib]) | |
require 'rubygems' | |
require File.join(File.dirname(File.expand_path(__FILE__)), 'lib/gollum/frontend/app') | |
$path = '/var/gollum/wiki.git' | |
Precious::App.set(:gollum_path, $path) | |
run Precious::App |
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
// Client | |
now.ready = function() { | |
now.changeGroup(window.location.pathname) | |
} | |
// Server | |
var app = express.createServer(); | |
var nowjs = require("now"); | |
var everyone = nowjs.initialize(app); |
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 sys = require('sys'); | |
var arguments = process.argv.splice(2)[0]; | |
console.log(sys.inspect(arguments)) |
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
// Only listen on $ node app.js <PORT> so we can test this code | |
if (!module.parent) { | |
var port = process.argv[2] || 8081 | |
app.listen(port); | |
console.log("Express server listening on port %d", app.address().port); | |
} |
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
set :application, "appname" | |
set :deploy_to, "/var/www" | |
set :scm, :git | |
set :repository, "[email protected]:user/app.git" | |
default_run_options[:pty] = true | |
set :user, "www-data" | |
set :domain, "foo.tld" | |
set :normalize_asset_timestamps, false |
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 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
require 'akephalos' | |
Capybara.run_server = true | |
Capybara.current_driver = :akephalos | |
Capybara.app_host = 'http://localhost:8081' |
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
CREATE TABLE for_ddl LIKE foo; | |
insert into for_ddl select * from foo WHERE ...; | |
ALTER TABLE for_ddl DROP INDEX bar; | |
more ddl... | |
RENAME TABLE foo TO old_foo; | |
RENAME TABLE for_ddl TO foo; | |
DROP TABLE old_foo; |
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
context "REST requests" do | |
use_vcr_cassette "connection_refused_error", :record => :all | |
message = "Connection refused - when attempting request: POST http://localhost:80 with headers: and payload: payload" | |
it "should tell me what happened when it was a refused connection" do | |
lambda { | |
RestClient.post("http://localhost:80", 'payload') | |
}.should raise_error(Errno::ECONNREFUSED, message) | |
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
sudo apt-get install unzip | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.4.zip | |
unzip elasticsearch-0.17.4.zip | |
sudo apt-get install python-software-properties | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jre sun-java6-plugin | |
sudo mv elasticsearch-0.17.4 /usr/local/share | |
cd elasticsearch-servicewrapper | |
sudo mv service /usr/local/share/elasticsearch-0.17.4/bin |
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
opening connection to superfeedr.com... | |
opened | |
opening connection to superfeedr.com... | |
opened | |
<- "POST /hubbub HTTP/1.1\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: close\r\nAuthorization: Basic c3VwZXJmZWVkckBub25maWN0aW9uLmNhOnN1cGVyZmVlZHI=\r\nContent-Length: 837\r\nHost: superfeedr.com\r\n\r\n" | |
<- "hub.topic=http%3A%2F%2Fsearch.twitter.com%2Fsearch.atom%3Fgeocode%3D49.170175%2C-123.136617%2C100.0km%26q%3D%22WaterMania%22%20OR%20%22Wild%20Whales%20Vancouver%22%20OR%20%22Pacific%20National%20Exhibition%22%20OR%20%22Richmond%20Olympic%20Oval%22%20OR%20%22Skydive%20Vancouver%22%20OR%20%22ClearOne%20Sports%20Ltd%22%20OR%20%22Summer%20Night%20Market%20(Lions%20Communications%20Ltd)%22%20OR%20%22Vancouver%20Lookout%22%20OR%20%22Britannia%20Mine%20Museum%22%20OR%20%22K%20fever%20Karaoke%22%20OR%20%22Thrangu%20Monastery%20Association%22%20OR%20%22iFLY%20Vancouver%20Indoor%20Skydiving%20Inc%22%20OR%20%226%20Pack%20Beach%22%20OR%20%22Grouse%20Mountain%20Resort%22%20OR%20%22Vancouver%20Art%20Gal |