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
| # | |
| gem install ruby-debug19 -- --with-ruby-include=/home/belbo/.rvm/src/ruby-1.9.2-head/ |
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
| touch tailme | |
| # Tail the same file twice | |
| tailer.rb tailme | |
| echo "smth" |cat >tailme | |
| # results: | |
| Tailing tailme | |
| Tailing tailme |
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 Munin | |
| include EM::Deferrable | |
| Delimiter = "\n".freeze | |
| End = '.'.freeze | |
| def receive_data(data) | |
| (@buffer||='') << data | |
| while index = @buffer.index(Delimiter) |
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
| # checkout: http://github.com/igrigorik/async-rails/ | |
| From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
| From: Ilya Grigorik <[email protected]> | |
| Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
| Subject: [PATCH] async rails3 | |
| --- | |
| Gemfile | 6 ++++++ | |
| app/controllers/widgets_controller.rb | 6 ++++++ |
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: unicorn_github | |
| # Script used to start unicorn in GitHub staging and production environments. | |
| # This is called primarily by god. | |
| set -e | |
| # configure GC settings | |
| export RUBY_HEAP_MIN_SLOTS=800000 | |
| export RUBY_HEAP_FREE_MIN=100000 | |
| export RUBY_HEAP_SLOTS_INCREMENT=300000 |
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 "redis" | |
| require "nest" | |
| redis = Redis.new | |
| users = Nest.new(:users, redis) | |
| posts = Nest.new(:posts, redis) | |
| user = users[users.incr] | |
| user.hmset(:name, "Albert") |
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
| user nginx; | |
| worker_processes 5; | |
| error_log /var/log/nginx.error.log; | |
| pid /var/run/nginx.pid; | |
| events { | |
| worker_connections 1024; | |
| } | |
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
| -> ab -c 10 -n 10 http://localhost:3000/timer | |
| This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
| Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
| Licensed to The Apache Software Foundation, http://www.apache.org/ | |
| Benchmarking localhost (be patient).....done | |
| Server Software: thin | |
| Server Hostname: localhost |
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
| From bb2a78858cffa7c6937642986e9aca1a4f862c0d Mon Sep 17 00:00:00 2001 | |
| From: Ilya Grigorik <[email protected]> | |
| Date: Thu, 10 Jun 2010 00:46:48 -0400 | |
| Subject: [PATCH] async rails3 | |
| --- | |
| Gemfile | 6 ++++++ | |
| app/controllers/widgets_controller.rb | 6 ++++++ | |
| app/models/widget.rb | 2 ++ | |
| config.ru | 1 + |
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 'dalton/strategies/skroutz' | |
| require 'dalton/strategies/facebook' | |
| require 'dalton/strategies/openid' # yahoo, #google | |
| require 'dalton/strategies/twitter' | |
| # Setup OpenId file storage, don't change the storage engine! | |
| require 'openid/store/filesystem' | |
| Rails.configuration.middleware.use(Rack::OpenID, | |
| OpenID::Store::Filesystem.new(Rails.root + 'tmp/openid')) |