Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Here are the version numbers available for Handlebars.js
+--------------+------------------+------------------+--------------+
| npm versions | Official website | GitHub downloads | Git tags |
+--------------+------------------+------------------+--------------+
| 1.0.2beta | 1.0.0-rc.3 | 0.9.0.pre.2 | 0.9.0.pre.4 |
| 1.0.4beta | | 0.9.0.pre.3 | 1.0.0.beta.1 |
| 1.0.5beta | | 0.9.0.pre.4 | 1.0.0-rc.3 |
| 1.0.6 | | 0.9.0.pre.5 | 1.0.rc.1 |
| 1.0.6-2 | | 0.9.0.pre.js | 1.0.rc.2 |
@iangreenleaf
iangreenleaf / Makefile
Last active December 15, 2015 10:58
Ruby-style mixins in JavaScript.
test:
for f in test-*.coffee; do coffee "$$f"; done
.PHONY: test
@iangreenleaf
iangreenleaf / a_b_helper.rb
Created November 27, 2012 19:59
Helper to provide alternate configuration syntax for Split, the A/B testing tool.
module ABHelper
def split_test(name)
experiment = YAML.load_file("config/experiments.yml")[name]
given_probability, num_with_probability = experiment[:variants].inject([0,0]) do |a,v|
p, n = a
if v.kind_of?(Hash) && v[:percent]
[p + v[:percent], n + 1]
else
a
def with_var(variable, value, &block)
old_value = eval variable
eval "#{variable} = #{value.inspect}"
ret = block.call
eval "#{variable} = #{old_value.inspect}"
ret
end
# Usage
# =====
@iangreenleaf
iangreenleaf / gist:2361836
Created April 11, 2012 19:44
Projects to do someday

These are projects I would build if I had more hours in the day. If you build one of these, let me know!

  • License-bot: Trawl a user's Github repos and look for:
    1. Projects with no license attached.
  1. Licenses with outdated copyright years.
@iangreenleaf
iangreenleaf / php_test.rb
Created December 22, 2011 23:39
Rough tests for tap_out
# ruby -Ilib php_test.rb
require 'test/phpunit'
require 'test/unit'
class PHPTest < Test::Unit::TestCase
extend Test::PHPUnit
phpunit "test.php"
end
https = require 'https'
module.exports.request = ( options, success_handler, error_handler) ->
req_data = if options.data? then JSON.stringify options.data else ""
options['headers'] ?= {}
options['headers']['Content-length'] = req_data.length
req = https.request options, (res) ->
data = ''
res.on 'data', (c) ->
data += c
@iangreenleaf
iangreenleaf / gist:1403976
Created November 29, 2011 08:14
Twitter doesn't know shit about frontend
// This came straight from Twitter's index.html. Enclosed in <script> tags.
// Apparently they do not know about minifiers, or the document-ready event.
// Magical invocations for frame-busting is a great plan, though.
// No, I don't know what their goddamn problem is either.
function bust() {
document.write = "";
window.top.location = window.self.location;
setTimeout(function () {
document.body.innerHTML = '';
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=3
inherit eutils git
DESCRIPTION="A package manager for nodejs."
HOMEPAGE="https://github.com/isaacs/npm/"
SRC_URI=""
@iangreenleaf
iangreenleaf / rvmrc
Created June 21, 2011 06:27
rvm ebuild for Gentoo - not completely kosher
umask g+w
export rvm_path="/usr/local/rvm"