Skip to content

Instantly share code, notes, and snippets.

@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.

@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 / 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 / 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 / .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