Skip to content

Instantly share code, notes, and snippets.

View christoomey's full-sized avatar

Chris Toomey christoomey

View GitHub Profile
@christoomey
christoomey / Guardfile
Created May 23, 2011 19:40 — forked from ordinaryzelig/Guardfile
guard-coffeescript config for entire directory structure
guard 'coffeescript', {
:output => '.compiledJS',
:bare => true
} do
watch %r{(.*/(.+\.coffee))}
end
@christoomey
christoomey / gist:1206762
Created September 9, 2011 17:09
Linode Ubuntu 10.04 (Lucid) with passenger & nginx for rails hosting
#################################################################
# #
# A guide to setting up a linode Ubuntu VPS for #
# Ruby on Rails hosting with nginx & passenger #
# #
# Compiled by Chris Toomey [ctoomey.com] on Sept. 9 2011 #
# #
#################################################################
# Start with base 10.04 image. Setup the DNS for any domains you
@christoomey
christoomey / gist:1238761
Created September 24, 2011 00:12
nginx management script
#! /bin/sh
### BEGIN INIT INFO
#
# Source https://raw.github.com/jnstq/rails-nginx-passenger-ubuntu/master/nginx/nginx
#
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@christoomey
christoomey / gist:1359824
Created November 12, 2011 00:55
Clean all the gems!
gem list | cut -d ' ' -f 1 | while read g; do gem uninstall -aIx $g; done
@christoomey
christoomey / Gemfile
Created February 18, 2012 03:57
Sprockets sans Rails
source :rubygems
gem "middleman", ">=2.0" # Configure Sprockets
gem "jquery-rails" # provide jquery in a rails engine
gem "backbone-rails" # provides underscore as well
gem "bourbon" # thoughtbot SASS mixins
gem "ejs" # provide JST global access to templates
gem "handlebars_assets" # use handlebars JS template engine
gem "rb-fsevent" # OS notifications for file changes (rather than polling)
@christoomey
christoomey / quix.txt
Created June 29, 2012 12:40
Quix custom searches
@Chris's searches
@Chris's custom searches
go https://duckduckgo.com/?q=%21%20%s Open first result (DuckDuckGo)
gh http://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1 Search GitHub (everything)
@christoomey
christoomey / canvas.html
Created July 26, 2012 20:43
Canvas Radial Gradient w/ Prerendering
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: auto;
padding: 0px;
}
</style>
<script>
@christoomey
christoomey / index.coffeescript
Created July 26, 2012 21:06
A web page created at CodePen.io.
preRender = ->
canvas = document.getElementById 'preRender'
context = canvas.getContext '2d'
radius = 20
centerX = centerY = radius + 1
context.beginPath()
context.arc centerX, centerY, radius, 0, (2 * Math.PI), false
x = Math.floor(radius - (radius / 3))
@christoomey
christoomey / spanWrapper.js.coffee
Created November 15, 2012 00:31
Javascript utility to wrap instances of a search string within a target string
window.CJT or= {}
class CJT.SpanWrapper
STRING_NOT_FOUND: -1
constructor: (options={}) ->
@tagname = options.tagname ? 'span'
@classname = options.classname ? ''
wrap: (target, searchString) =>
@christoomey
christoomey / spanWrapper.js
Created November 15, 2012 01:00
Compiled js version of spanWrapper utility
// Compiled js version of spanWrapper library written in coffeescript.
// Source code can be found in https://gist.github.com/4075843
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
window.CJT || (window.CJT = {});
CJT.SpanWrapper = (function() {
SpanWrapper.prototype.STRING_NOT_FOUND = -1;