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
| **Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance. | |
| You can install the extension as follows: | |
| gem install bson_ext | |
| If you continue to receive this message after installing, make sure that the | |
| bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version. |
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 'mechanize' | |
| require 'singleton' | |
| BASE = 'http://goo.gl/'.freeze | |
| REDIR = "#{BASE}?authen=1".freeze | |
| NOISE = "#{BASE}?url=".freeze | |
| class GooAPI | |
| include Singleton |
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 client for testing high connection concurrency | |
| // Authors: Richard Jones and Rasmus Andersson | |
| // Released in the public domain. No restrictions, no support. | |
| #include <sys/types.h> | |
| #include <sys/time.h> | |
| #include <sys/queue.h> | |
| #include <stdlib.h> | |
| #include <err.h> | |
| #include <event.h> | |
| #include <evhttp.h> |
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 = require('http') | |
| url = require('url') | |
| fs = require('fs') | |
| io = require('../') | |
| sys = require(if process.binding('natives').util then 'util' else 'sys') | |
| server = http.createServer (req, res) -> | |
| path = url.parse(req.url).pathname | |
| switch path | |
| when "/" |
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 'rubygems' | |
| require 'em-http' | |
| require 'json' | |
| EM.run { | |
| username = 'tw_user' | |
| password = 'tw_password' | |
| buffer = "" | |
| http = EventMachine::HttpRequest.new('http://stream.twitter.com/1/statuses/filter.json').post({ |
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 http = require("http"), | |
| util = require("util") | |
| http.createServer(function(req, rsp){ | |
| var regex = /^\/(v1|v2)/g | |
| var matches = req.url.match(regex) | |
| if((matches && matches[0] === "/v1") || (req.headers["x-api-version"] === "v1")) | |
| var port = 8001 |
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
| #!/bin/sh | |
| # Usage: bash < <(curl -s https://gist.github.com/raw/965142/install.sh) | |
| # Have sudo ask us for our password before we kick everything off so we can walk away. | |
| sudo echo "Here we go..." | |
| echo "Installing RVM..." | |
| bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
| source $HOME/.rvm/scripts/rvm |
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 tls = require('tls'); | |
| var fs = require('fs'); | |
| var Buffer = require('buffer').Buffer; | |
| var zlib = require('zlib'); | |
| var BufferList = require('bufferlist'); | |
| var Binary = require('bufferlist/binary'); | |
| var Put = require('put'); | |
| var http = require('http'); | |
| var options = |
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 'em-redis' | |
| require 'redis' | |
| require 'redis/distributed' | |
| require "fiber_pool" | |
| class Redis | |
| class Distributed | |
| def initialize(urls, options = {}) | |
| @tag = options.delete(:tag) || /^\{(.+?)\}/ |
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
| /* Ismael Celis 2010 | |
| Simplified WebSocket events dispatcher (no channels, no users) | |
| var socket = new FancyWebSocket(); | |
| // bind to server events | |
| socket.bind('some_event', function(data){ | |
| alert(data.name + ' says: ' + data.message) | |
| }); |