Skip to content

Instantly share code, notes, and snippets.

View tomazzlender's full-sized avatar
👨‍💻

Tomaz Zlender tomazzlender

👨‍💻
View GitHub Profile
var CustomEvents = (function() {
var _map = {};
return {
subscribe: function(name, cb) {
_map[name] || (_map[name] = []);
_map[name].push(cb);
},
notify: function(name, data) {
@tomazzlender
tomazzlender / unicorn
Created February 22, 2012 14:24 — forked from shapeshed/unicorn
unicorn init.d
/usr/sbin/update-rc.d -f unicorn defaults
chmod +x /etc/init.d/unicorn
/usr/sbin/update-rc.d -f unicorn remove
set :rails_env, :production
set :unicorn_binary, "/usr/bin/unicorn"
set :unicorn_config, "#{current_path}/config/unicorn.rb"
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :deploy do
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D"
end
task :stop, :roles => :app, :except => { :no_release => true } do
@tomazzlender
tomazzlender / rbenv-install-system-wide.sh
Created February 18, 2012 14:22 — forked from slayer/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu to /opt/rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /opt/rbenv
# Add rbenv to the path:
@tomazzlender
tomazzlender / rbenv-install-system-wide.sh
Created February 17, 2012 20:35
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path: