This file contains hidden or 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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
This file contains hidden or 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/ruby | |
# | |
# I deliberately didn't DRY /usr/local references into a variable as this | |
# script will not "just work" if you change the destination directory. However | |
# please feel free to fork it and make that possible. | |
# | |
# If you do fork, please ensure you add a comment here that explains what the | |
# changes are intended to do and how well you tested them. | |
# | |
# 14th March 2010: |
This file contains hidden or 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
let's get Neo4j setup ... | |
jruby -r java -e "puts java.lang.System.get_property('java.class.path')" | |
jruby -S jirb | |
> require 'rubygems' # don't seem to need to require 'lucene' anymore | |
> require 'neo4j/auto_tx' # 'neo4j' req's a transaction wrapping like | |
This file contains hidden or 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
> NGINX Team, | |
> | |
> Is there a way to capture the User-Agent from an HTTP Header, then query a database for that User-Agent, then based on the result of the database query, transparently route the request to an appropriate server? | |
> | |
> Thanks, | |
> Sean | |
Sean- |
This file contains hidden or 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 'riak' | |
client = Riak::Client.new | |
bucket = client['people'] | |
sean = bucket.new('sean') | |
sean.data = {"name" => "Sean Cribbs"} | |
puts "Storing Justin." |
This file contains hidden or 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
bonsai | |
rdiscount |
This file contains hidden or 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
// one global css object | |
// | |
var css; | |
(function(){ | |
css = function(){ | |
// static data | |
// | |
this.data = |
This file contains hidden or 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
http_path = "/" # Root of project when deployed | |
css_dir = "public/stylesheets" | |
sass_dir = "public/stylesheets/sass" | |
images_dir = "images" | |
javascripts_dir = "javascripts" | |
relative_assets = true |
This file contains hidden or 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 child_process = require('child_process'), | |
sys = require('sys'), | |
net = require('net'), | |
netBinding = process.binding('net'); | |
var fd = netBinding.socket('tcp4'); | |
netBinding.bind(fd, 8080); | |
netBinding.listen(fd, 128); | |
for (var i = 0; i < 4; i++) { |
This file contains hidden or 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
(:import | |
[java.net InetSocketAddress] | |
[java.util.concurrent Executors] | |
[org.jboss.netty.bootstrap ServerBootstrap] | |
[org.jboss.netty.channel Channels ChannelPipelineFactory] | |
[org.jboss.netty.channel.socket.nio NioServerSocketChannelFactory]) |