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
sudo gem uninstall memcached | |
sudo env ARCHFLAGS="-arch x86_64" gem install memcached |
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 "erb" | |
require "redis" | |
module Rack | |
class Out | |
DEFAULTS = { :secret => "secretive-secret", :key => "rack:out", | |
:host => "127.0.0.1", :port => 6379, :db => 0, :timeout => 5, :password => nil, | |
:logger => nil, :thread_safe => nil } | |
def initialize(app, 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
module Punycode | |
module Status | |
class Error < StandardError; end | |
class PunycodeSuccess; end | |
# Input is invalid. | |
class PunycodeBadInput < Error; end | |
# Output would exceed the space provided. | |
class PunycodeBigOutput< Error; end | |
# Input needs wider integers to process. | |
class PunycodeOverflow < Error; end |
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
rails_env = ENV['RAILS_ENV'] || "production" | |
rails_root = ENV['RAILS_ROOT'] || "/var/www/yourapp/current" | |
num_workers = 1 | |
num_workers.times do |num| | |
God.watch do |w| | |
w.name = "resque-#{num}" | |
w.group = 'resque' | |
w.interval = 30.seconds | |
w.start = "cd #{rails_root} && env QUEUE=* RAILS_ENV=#{rails_env} /usr/bin/rake -f #{rails_root}/Rakefile environment resque:work" |
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
zstyle ":completion:*" use-cache on | |
zstyle ":completion:*" cache-path ~/.zsh/cache |
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 "sinatra" | |
require "oauth" | |
require "oauth/consumer" | |
enable :sessions | |
before do | |
session[:oauth] ||= {} |
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
class Redis | |
def get(key) | |
call_command [:get, key] | |
end | |
end |
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
<html> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<script> | |
function start(){ | |
localStorage['script'] = ''; | |
window.odswierzaj = false; | |
chrome.browserAction.setBadgeText({text: ""}); | |
window.bliplogin = localStorage['bliplogin']; | |
window.bliphaslo = localStorage['bliphaslo']; | |
window.dzialanie = localStorage['dzialanie']; |
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 "eventmachine" | |
module Thrift | |
class EventMachineServer < BaseServer | |
def initialize(processor) | |
@em = Class.new(EM::Connection) do | |
class << self | |
attr_accessor :processor | |
end |
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
def dispatch!(connection, clazz) | |
n = 0 | |
for queue in @routing.queue_names_routing_class(clazz) | |
begin | |
result = connection.retrieve(queue) | |
if result | |
n += 1 | |
handler = @routing[queue] | |
method_name = @routing.method_name(queue) | |
logger.debug("Calling #{handler.class.to_s}\##{method_name}(#{result.inspect})") |
OlderNewer