Skip to content

Instantly share code, notes, and snippets.

View awesome's full-sized avatar

So Awesome Man awesome

View GitHub Profile

1 element

h = { 
  hoge: <<EOS
Hey!
EOS
}

p h
@awesome
awesome / heredoc.rb
Created January 29, 2014 20:46 — forked from hideo55/heredoc.rb
h = {
hoge: <<EOS,
Hey!
EOS
fuga: <<EOS
Yo!
EOS
}
p h
@awesome
awesome / bob.rb
Last active August 29, 2015 13:55 — forked from cschneid/bob.rb
class Bob
RESPONSES = {
:shouting => "Woah, chill out!",
:silence => "Fine. Be that way.",
:question => "Sure.",
:statement => "Whatever.",
}
def hey(statement)
validate_statement(statement)
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
# Unicorn configuration file to be running by unicorn_init.sh with capistrano task
# read an example configuration before: http://unicorn.bogomips.org/examples/unicorn.conf.rb
#
# working_directory, pid, paths - internal Unicorn variables must to setup
# worker_process 4 - is good enough for serve small production application
# timeout 30 - time limit when unresponded workers to restart
# preload_app true - the most interesting option that confuse a lot of us,
# just setup is as true always, it means extra work on
# deployment scripts to make it correctly
# BUNDLE_GEMFILE - make Gemfile accessible with new master
worker_processes 3 # amount of unicorn workers to spin up
timeout 30 # restarts workers that hang for 30 seconds
# fine tuning
preload_app true
GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true
before_exec do |server|
ENV['RUBY_HEAP_MIN_SLOTS']=800000
ENV['RUBY_GC_MALLOC_LIMIT']=59000000
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
# This is example contains the bare mininum to get nginx going with
# Unicorn or Rainbows! servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
" ir_black color scheme
" More at: http://blog.infinitered.com
" ********************************************************************************
" Standard colors used in all ir_black themes:
" Note, x:x:x are RGB values
"
" normal: #f6f3e8
"
@awesome
awesome / .vimrc
Last active August 29, 2015 13:56
set history=10000
set ruler
set autoindent
set nosmartindent
set showcmd
set nu
set sw=2
syntax off
set encoding=utf-8 fileencodings=
set showmatch