Skip to content

Instantly share code, notes, and snippets.

View gartenfeld's full-sized avatar

David Rosson gartenfeld

View GitHub Profile
@gartenfeld
gartenfeld / app.js
Created March 21, 2017 20:50 — forked from Turbo87/app.js
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@gartenfeld
gartenfeld / introrx.md
Created April 21, 2016 00:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@gartenfeld
gartenfeld / backbone-collection-cycle.coffee
Last active August 29, 2015 14:26 — forked from rjz/backbone-collection-cycle.coffee
Find next model in a Backbone Collection
# Methods for cycling through the models in a Backbone Collection
# Usage:
#
# c = new MyCollection([...])
# nextModel = c.modelAfter(myModel)
# myModel == c.modelBefore(nextModel)
# # true
#
class MyCollection extends Backbone.Collection
@gartenfeld
gartenfeld / letters-to-100.py
Last active August 29, 2015 14:10 — forked from peterjmag/letters-to-100.py
English words with "letter score" adding up to 100, sorted by frequency.
import re # Regular Expressions
import collections # Data Types
import sys # File operations
import codecs # UniCode support
import os
import operator
import string
def load_freq(freq_f):
db.collection.aggregate([
{ $group: {
_id: { firstField: "$firstField", secondField: "$secondField" },
uniqueIds: { $addToSet: "$_id" },
count: { $sum: 1 }
}},
{ $match: {
count: { $gt: 1 }
}},
{ $group: {