Skip to content

Instantly share code, notes, and snippets.

@snooc
snooc / .vimrc
Created May 4, 2011 19:09 — forked from jeresig/.vimrc
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on
@snooc
snooc / nginx
Created February 28, 2012 05:22 — forked from hisea/nginx
ubuntu passenger nginx init.d script
sudo cp nginx /etc/init.d/
sudo update-rc.d nginx defaults
sudo chmod +x /etc/init.d/nginx
/etc/init.d/nginx start
@snooc
snooc / Gemfile
Created August 3, 2012 19:46 — forked from mpautasso/Gemfile
RefineryCMS integration with existing Rails 3.2.3
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'pg'
gem 'thin'
gem 'activeadmin'
# Add users roles management
gem 'cancan'
# Add IP reverse geocoding support
@snooc
snooc / chef_solo_bootstrap.sh
Created September 4, 2012 02:48 — forked from cmaitchison/chef_solo_bootstrap.sh
CentOS 6.3 Chef-Solo bootstrap (RackSpace)
#!/bin/bash -xe
#THIS SCRIPT MUST BE RUN AS ROOT
ADMIN_USER=admin
ADMIN_GROUP=admin
#add admin group
(cat /etc/group | grep -E '\b$ADMIN_GROUP\b') || sudo groupadd $ADMIN_GROUP
@snooc
snooc / centos6.3-chef-solo-bootstrap.sh
Created September 5, 2012 20:24
CentOS 6.3 Chef-Solo Bootstrap - Ruby1.9.3 + libyaml
#! /bin/bash
#####################
# Run this as root! #
#####################
yum update
yum groupinstall "Development Tools"
yum install zlib-devel readline-devel openssl-devel
@snooc
snooc / README.markdown
Created November 6, 2012 19:30 — forked from greypants/README.markdown
RAILS 3: nav_link helper for adding 'selected' class to navigation elements

#Behold, the nav_link:

The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.

For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper

Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.

# 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:
@snooc
snooc / gist:4543845
Last active December 11, 2015 04:18

Setup Rails App Server

nginx, passenger, rails, rbenv, ruby 1.9.3-p362

root$

  1. ssh root@ip.add.re.ss to SSH into server

  2. apt-get -y update To update sources

  3. apt-get -y upgrade To upgrade the OS

  4. To install libraries needed to compile ruby:

#!/bin/bash
set -e # exit on error
### README
# * built for Ubuntu (Lucid Lynx)
# * uses GIT via SSH because of !@#$% proxy at work
# * installs your desired ruby version (1.9.2-p290 per default) using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/autorun'
require 'minitest/pride'
require 'capybara/rails'
class MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown