Skip to content

Instantly share code, notes, and snippets.

@gregorymostizky
gregorymostizky / svn ignore recursive
Created January 30, 2011 10:44
Recursive SVN ignore from command line
echo -e ".backup\nlogs\nvendor" | xargs -d# -Ixx svn propset svn:ignore 'xx' . --recursive
@gregorymostizky
gregorymostizky / redis-em-patch
Created January 25, 2011 16:16
Patch redis and em-redis to work together
require 'em-redis'
require 'redis'
require 'redis/distributed'
require "fiber_pool"
class Redis
class Distributed
def initialize(urls, options = {})
@tag = options.delete(:tag) || /^\{(.+?)\}/
@gregorymostizky
gregorymostizky / redis.expect
Created January 25, 2011 13:22
Check if redis is up using telnet and expect
set timeout 5
spawn telnet [lindex $argv 0] [lindex $argv 1]
expect "Connected"
send "PING\n"
expect "+PONG"
send "QUIT"
#usage: expect redis.expect <host> <port>
@gregorymostizky
gregorymostizky / sinatra_fiber.rb
Created December 28, 2010 18:27
Patches async sinatra to use Fiber.new{}.resume for every request
#encoding: utf-8
# Patches async sinatra to use Fiber.new{}.resume for every request
require "sinatra/async"
require "fiber"
module Sinatra
module Async
module Helpers