Skip to content

Instantly share code, notes, and snippets.

@icleversoft
icleversoft / 0_reuse_code.js
Created November 11, 2015 18:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@icleversoft
icleversoft / unicorn
Last active August 29, 2015 14:17 — forked from shapeshed/unicorn
#!/bin/sh
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/path/to/your/app/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENVIRONMENT=production
require_relative "task"
desc "Send an invite"
task :invite do |name, email|
puts "Invitation sent to '#{name} <#{email}>'"
end
# Example:
#
# $ rake invite "Paul Engel" paul@engel.com
###Package for installation
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
sudo yum install redis -y
###Start the server
sudo service redis start
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
#include <dispatch/dispatch.h>
typedef void (^MHChannelsBlock)(id sender, NSDictionary *dictionary);
/*!
* A "channel" is like a private NSNotificationCenter between just two objects
* (although more are possible).
*
* Instead of making your objects, such as two view controllers, communicate
@icleversoft
icleversoft / README.md
Created October 12, 2012 11:20 — forked from mloughran/README.md
EventMachine

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@icleversoft
icleversoft / unicorn
Created April 25, 2012 16:18
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by jay@gooby.org http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@icleversoft
icleversoft / unicorn.rb
Last active October 3, 2015 15:37 — forked from killercup/README.md
Unicorn Config
APP_ROOT = File.expand_path(File.dirname(File.dirname(__FILE__)))
RAILS_ROOT = APP_ROOT
if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
rvm_path = File.dirname(File.dirname(ENV['MY_RUBY_HOME']))
rvm_lib_path = File.join(rvm_path, 'lib')
#$LOAD_PATH.unshift rvm_lib_path
require 'rvm'
RVM.use_from_path! APP_ROOT
@icleversoft
icleversoft / gist:2479085
Created April 24, 2012 11:56 — forked from matiaskorhonen/gist:420880
Unicorn(RVM) Script file
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO