Skip to content

Instantly share code, notes, and snippets.

@elblivion
elblivion / curlformat
Last active March 29, 2018 07:44
curlformat
Timings:
DNS lookup: %{time_namelookup}
Connection: %{time_connect}
SSL negotiation: %{time_appconnect}
Total: %{time_total}
\n
@remcoder
remcoder / typescript.sublime-build
Created October 1, 2012 19:48
Sublime Text 2 build system for Typescript
{
"selector": "source.ts",
"cmd": ["tsc", "$file"],
"file_regex": "^(.+?) \\((\\d+),(\\d+)\\)(: .+)$",
"line_regex": "\\((\\d+),(\\d+)\\)",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
@geddski
geddski / nesting.js
Created January 14, 2012 05:08
helper function for nesting backbone collections.
function nestCollection(model, attributeName, nestedCollection) {
//setup nested references
for (var i = 0; i < nestedCollection.length; i++) {
model.attributes[attributeName][i] = nestedCollection.at(i).attributes;
}
//create empty arrays if none
nestedCollection.bind('add', function (initiative) {
if (!model.get(attributeName)) {
model.attributes[attributeName] = [];
@aslakhellesoy
aslakhellesoy / poor-mans-npm-registry.js
Created June 22, 2011 14:50
A dummy npm server useful for publishing private packages
// A very simple npm server that you can `npm publish` to.
// Useful for publishing internal packages.
//
// Writes the published .tgz package to disk under tmp/
//
// In your own project's `package.json`, add this:
//
// "publishConfig":{"registry":"http://localhost:9911"}
//
// Before you publish the first time you also need to