Skip to content

Instantly share code, notes, and snippets.

View hypermano's full-sized avatar

Emmanuel Alhadeff hypermano

View GitHub Profile
@darcy
darcy / gist:2896009
Created June 8, 2012 14:51
MongoDB Trigram Search
// THIS SHOULD WORK AS COPY/PASTE into mongo console
var games = ["here is a test", "small test", "another game"];
var query = 'here is testing a test';
//////////////////////////////////////////////
// 1. util functions
var intersect = function(arr1, arr2) {
@AndrewO
AndrewO / gist:1841191
Created February 16, 2012 02:45
PhantomJS code to dump computed styles of all elements and take a screenshot
[url, height, width, output_dir] = phantom.args
console.log("url #{url}, height #{height}, width #{width}, output_dir #{output_dir}")
page = require('webpage').create()
page.viewportSize =
width: width
height: height
page.onConsoleMessage = (msg) ->