Skip to content

Instantly share code, notes, and snippets.

View samnang's full-sized avatar
🚀

Samnang Chhun samnang

🚀
View GitHub Profile
@samnang
samnang / es.sh
Last active December 14, 2015 20:29
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.3.deb
sudo dpkg -i elasticsearch-0.90.3.deb
sudo service elasticsearch start
sudo service elasticsearch start
# If you see "WARNING: ElasticSearch may have failed to start."
@samnang
samnang / _test.rb
Created November 8, 2012 16:33 — forked from jcoglan/_test.rb
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
@samnang
samnang / 0-readme.md
Created September 17, 2012 04:23 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@samnang
samnang / links.textile
Created July 12, 2012 16:55 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@samnang
samnang / links.textile
Created May 23, 2012 18:13 — forked from lucashungaro/links.textile
Links de referência utilizados em minha palestra
@samnang
samnang / gist:2601575
Created May 5, 2012 11:03 — forked from ambar/gist:1534274
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@samnang
samnang / ruby_gc.sh
Created May 1, 2012 05:15 — forked from mikhailov/ruby_gc.sh
Ruby’s GC Configuration
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
article’s settings: ("spec spec" took 17-23!sec)
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500
@samnang
samnang / pair.md
Created April 11, 2012 16:35 — forked from wm/pair.md
TMUX Pairing

SSH setup for remote pairing

If Animal and Fozzie wanted to pair on Animals machine and they both have access to shared.muppets.com then they could use the following setup

  • Animal will have the following in ~/.ssh/config
Host tunnel_from_muppets
  Hostname space.muppets.com
 RemoteForward 1235 localhost:22
@samnang
samnang / api_controller.rb
Created April 1, 2012 15:41 — forked from ahawkins/api_controller.rb
Basic API style controller for Rails
# A Basic API Controller for Rails
# Handles authentication via Headers, params, and HTTP Auth
# Automatically makes all requests JSON format
#
# Written for production code
# Made public for: http://broadcastingadam.com/2012/03/state_of_rails_apis
#
# Enjoy!
class ApiController < ApplicationController
@samnang
samnang / osx_rails_env_setup_in_1_step.md
Created April 1, 2012 15:29 — forked from mpapis/osx_rails_env_setup_in_1_step.md
One step to get up'n'running with Rails on OS X or Linux

Use this command and follow the instructions:

bash -s stable --rails < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Other options include(any gems imply --ruby):

--ruby=1.9.3
--gems=rails,gist

Optionally on OSX install homebrew, use brew command to install whatever database engine you need, ie brew install sqlite