This file contains 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
#!upstart | |
description "redis" | |
start on runlevel [23] | |
script | |
export HOME="/home/redis" | |
exec sudo -u redis /home/redis/redis-2.0.0-rc2/redis-server /home/redis/redis-2.0.0-rc2/redis.conf | |
end script |
This file contains 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
# IRBRC file by Iain Hecker, http://iain.nl | |
# put all this in your ~/.irbrc | |
require 'rubygems' | |
require 'yaml' | |
alias q exit | |
class Object | |
def local_methods | |
(methods - Object.instance_methods).sort |
This file contains 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
/Users/heli/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:71: warning: already initialized constant State | |
/Users/heli/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:72: warning: already initialized constant SAFE_STATE_PROTOTYPE | |
/Users/heli/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:73: warning: already initialized constant FAST_STATE_PROTOTYPE | |
/Users/heli/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:80: warning: already initialized constant PRETTY_STATE_PROTOTYPE | |
/Users/heli/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/pure.rb:76: warning: already initialized constant JSON_LOADED |
This file contains 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 Book < ActiveRecord::Base | |
belongs_to :auther | |
searchable do | |
text :title, :default_boost => 2 | |
text :description | |
time :updated_at # for sorting by recent | |
integer :auther_id, :multi => true do | |
authers.map {|auther| auther.auther_id} | |
end | |
boolean :published, :using => :published? |
This file contains 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 2.3.5 - 2.3.11 environment settings (config/environment.rb) | |
config.gem 'airbrake', :version => '2.4.11', :require => "hoptoad_notifier" | |
# Rails 3 - bundler Gemfile(config/Gemfile) | |
gem 'airbrake', '2.4.11', :require => "hoptoad_notifier" | |
# In Hoptoad initializer (config/hoptoad.rb) | |
HoptoadNotifier.configure do |config| | |
config.api_key = '<api key>' | |
config.host = 'airbrakeapp.com' |
This file contains 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 2.3.5 - 2.3.11 environment settings (config/environment.rb) | |
config.gem 'airbrake', :version => '2.4.11', :require => "hoptoad_notifier" | |
# Rails 3 - bundler Gemfile(config/Gemfile) | |
gem 'airbrake', '2.4.11', require => "hoptoad_notifier" | |
# In Hoptoad initializer (config/hoptoad.rb) | |
HoptoadNotifier.configure do |config| | |
config.api_key = '<api key>' | |
config.host = 'airbrakeapp.com' |
This file contains 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 deployer deployer; | |
worker_processes 1; | |
pid /var/run/nginx.pid; | |
worker_rlimit_nofile 30000; | |
events { | |
worker_connections 2048; | |
accept_mutex off; # "on" if nginx worker_processes > 1 | |
# multi_accept on; | |
use epoll; # enable for Linux 2.6+ |
This file contains 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
location ~ \.php { | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; |
This file contains 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
location = /robots.txt { access_log off; log_not_found off; } | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location ~ /\. { access_log off; log_not_found off; deny all; } | |
location ~ ~$ { access_log off; log_not_found off; deny all; } |
This file contains 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
# as we’re going to use Unicorn as the application server | |
# we’re not going to use common sockets | |
# but Unix sockets for faster communication | |
upstream linguist { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
# for UNIX domain socket setups: | |
server unix:/tmp/.sock fail_timeout=0; |
OlderNewer