Skip to content

Instantly share code, notes, and snippets.

View chrisnicola's full-sized avatar

Chris Nicola chrisnicola

View GitHub Profile
@paulmillr
paulmillr / brunch-heroku-deploy.md
Last active March 29, 2019 23:12
Build & deploy brunch applications on Heroku.
  1. Add to .gitignore:

    node_modules
    public
    
  2. Add to your app dependencies of package.json:

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@panthomakos
panthomakos / benchmark.rb
Created May 3, 2012 20:06
Benchmark Your Bundle
#!/usr/bin/env ruby
require 'benchmark'
REGEXPS = [
/^no such file to load -- (.+)$/i,
/^Missing \w+ (?:file\s*)?([^\s]+.rb)$/i,
/^Missing API definition file in (.+)$/i,
/^cannot load such file -- (.+)$/i,
]
@sapient
sapient / xirr.rb
Created November 14, 2011 20:07
XIRR Function Written for Ruby 1.9.2
require 'date'
require 'bigdecimal/newton'
require 'bigdecimal/math'
include Newton
class XIRR
def initialize(datevalues)
@datevalues = datevalues
@zero = BigDecimal::new("0.0")
@chrisnicola
chrisnicola / DynamicDictionary.cs
Created January 26, 2011 18:37
Updated dynamic dictionary with support for implicit casting
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq.Expressions;
using Microsoft.CSharp.RuntimeBinder;
namespace Nancy
{
public class DynamicDictionary : DynamicObject, IEquatable<DynamicDictionary>
{