This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modules = require('fs').readdirSync('node_modules').filter(function (name) {return name !== '.bin'}); | |
modules.forEach(function (m) { | |
console.time(m); | |
require(m); | |
console.timeEnd(m); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonpResponse(HttpResponse): | |
def __init__(self, data, callback): | |
json_encoder = LazyEncoder(ensure_ascii=False) | |
json = json_encoder.encode(data) | |
jsonp = "%s(%s)" % (callback, json) | |
HttpResponse.__init__( | |
self, jsonp, | |
mimetype='application/json' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Create new jekyll post and open in textmate | |
# $ ruby _new.rb This is the title | |
# The arguments form the title | |
unless ARGV[0] | |
raise "Please provide a post title." | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery log selector - v0.1pre - 6/2/2011 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
// Log the selector used to select elements to each selected element, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python -tt | |
"""Xcode4 installs and expects to find a git installation at /usr/bin. | |
This is a pain if you want to control your own installation of git that | |
might be installed elsewhere. This script replaces the git files in | |
/usr/bin with symlinks to the preferred installation. | |
Update the 'src_directory' to the location of your preferred git installation. | |
""" | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery seq - v0.1 - 03/1/2011 | |
* http://benalman.com/ | |
* | |
* Copyright (c) 2011 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(function($){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// testend on iOS | |
/* | |
Copyright 2011 Pedro Enrique | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XPUT localhost:9200/local -d '{ | |
"settings" : { | |
"analysis" : { | |
"analyzer" : { | |
"stem" : { | |
"tokenizer" : "standard", | |
"filter" : ["standard", "lowercase", "stop", "porter_stem"] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Ever wondered how to get the nice column of letters in the right side | |
* of the table view? | |
* | |
* Here is an example: | |
* 1. We take a list of names from a json file | |
* 2. We need to sort them by either first name or last name | |
* 3. We need to create a row header once in a while, when the first letter changes | |
* 4. We need to create a table index | |
* | |
*/ |
OlderNewer