Skip to content

Instantly share code, notes, and snippets.

View hemju's full-sized avatar
😃
Work Work

Helmut M Juskewycz hemju

😃
Work Work
View GitHub Profile
export JAVA_OPTS='-d32 -client -Xmx1g'
alias ls='ls -G'
alias ll='ls -l'
alias la='ls -la'
alias l='ls -l'
@hemju
hemju / Capistrano-Deployment-Recipe.rb
Created August 5, 2011 13:11 — forked from mrrooijen/Capistrano-Deployment-Recipe.rb
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
# 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;
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; }
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;
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+
@hemju
hemju / gist:1115341
Created July 30, 2011 08:48 — forked from sfilatov/gist:1109269
Migrate from Hoptoad to Airbrake
# 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'
@hemju
hemju / gist:1115340
Created July 30, 2011 08:48 — forked from sfilatov/gist:1109269
Migrate from Hoptoad to Airbrake
# 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'
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?
/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