Skip to content

Instantly share code, notes, and snippets.

View thegrubbsian's full-sized avatar

JC Grubbs thegrubbsian

View GitHub Profile
@searls
searls / app.css
Created May 18, 2014 14:38
Handy trick for debugging to see which parts of your app are being re-rendering in the DOM (without keeping your eyes glued to web inspector)
body * {
-webkit-animation: fade-in 2s ease-out;
animation: fade-in 2s ease-out;
}
@Sigmus
Sigmus / gulpfile.js
Last active November 15, 2017 11:55
gulpfile.js with browserify, reactify, watchify and gulp-notify.
var source = require('vinyl-source-stream');
var gulp = require('gulp');
var gutil = require('gulp-util');
var browserify = require('browserify');
var reactify = require('reactify');
var watchify = require('watchify');
var notify = require("gulp-notify");
var scriptsDir = './scripts';
var buildDir = './build';
@daytonn
daytonn / Gemfile
Created November 25, 2012 17:54
Automatic ejs template compilation
group :development do
gem 'ejs'
gem 'rb-fsevent' # optional
gem 'listen'
end
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@coreyhaines
coreyhaines / .rspec
Last active April 11, 2024 00:19
Active Record Spec Helper - Loading just active record
--colour
-I app
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@latentflip
latentflip / Rakefile
Created January 9, 2012 17:44
A better Rakefile for rails?
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
#Load all the tasks in lib/tasks
Dir[File.expand_path('../lib/tasks/', __FILE__) + '/*.rake'].each do |file|
load file
end
#The original rails rakefile loading
class SessionsController < ApplicationController
def new
if member = Member.find_by_password_digest(cookies[:digest])
session[:member_id] = member.id
redirect_to (session[:ref] || root_path), :notice => "Welcome back #{member.first_name}"
end
end
def create
@thhermansen
thhermansen / sunspot.rb
Created June 5, 2011 11:04
Sunspot rspec helper file
#
# Put this in spec/support/
# Will use a sunspot stub session as default in all tests.
#
# To actually test the search you'll need something like:
# describe "something", sunspot: true do
# ...some tests...
# end
#
# If you do this in your spec helper:
require 'benchmark'
d1 = [1,1,1,1,0,0,0,0,0]
d2 = [1,0,1,0,1,1,0,0,0]
d3 = [0,0,0,0,1,0,1,1,1]
def calc_sim vector1, vector2