Skip to content

Instantly share code, notes, and snippets.

///////
// Warning, code untested
///////
type Thinger interface {
SomeMethod( arg bool ) bool
}
type RealThing struct {
state bool
package main
import (
"net/http"
)
type SingleHost struct {
handler http.Handler
allowedHost string
}
package nettimeout
import (
"net"
"time"
)
// Listener wraps a net.Listener, and gives a place to store the timeout
// parameters. On Accept, it will wrap the net.Conn with our own Conn for us.
type Listener struct {
@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: