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
package main | |
import ( | |
"fmt" | |
"github.com/leesper/go_rng" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"time" |
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 'statsd' | |
$statsd = Statsd.new('your_host_here') | |
ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*args| | |
event = ActiveSupport::Notifications::Event.new(*args) | |
controller = event.payload[:controller] | |
action = event.payload[:action] | |
format = event.payload[:format] || "all" | |
format = "all" if format == "*/*" | |
status = event.payload[:status] |
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
This tutorial had a few bugs in it: | |
http://www.rethinkdb.com/docs/tutorials/elections/ | |
--- | |
getting started on Mac OS X... | |
The first few items are run in the terminal, and while I'm sure there are other ways to load the data, | |
I just went with what was in the tutorial, which included using the Python driver for Rethinkdb via pip. |
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
// Additional code in node-http-proxy.js | |
var crypto = require('crypto'); | |
var redis = require('redis'); | |
var client = redis.createClient(config.opt.redis_port, 'cloudno.de'); | |
client.auth(config.opt.redis_auth, function(result) { | |
util.log("Redis authenticated."); | |
}) |
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 'rubygems' | |
require 'redis' | |
$redis = Redis.new | |
class Request | |
def referrer | |
'http://www.google.com/search?q=Shopify+Store' | |
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
#Speeds up deployment by creating a copy of the project on the server, | |
set :deploy_via, :remote_cache | |
task :run_branch_check do | |
branches_available | |
check_for_deployment_branch | |
end | |
before "deploy", "run_branch_check" | |
before "deploy:long", "run_branch_check" |
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
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist |
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 'rubygems' | |
require 'uri' | |
require 'redis' | |
uri = URI.parse('redis://username:password@host:1234/') | |
unless uri.nil? | |
p uri.host | |
p uri.port | |
p uri.password | |
p '---' |
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
.DS_Store |
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
# Allow the metal piece to run in isolation | |
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
class Robots | |
def self.call(env) | |
if env["PATH_INFO"] =~ /^\/robots.txt/ | |
return disallow_multimedia if env["HTTP_HOST"] == 'www.something.biz' || env["HTTP_HOST"] =='something.biz' | |
return disallow_everything if env["HTTP_HOST"] =~ /\w*\.something.biz/ | |
return disallow_everything if env["HTTP_HOST"] =~ /\w*\.somethingelse.com/ | |
allow_everything |
NewerOlder