Skip to content

Instantly share code, notes, and snippets.

@mjhm
mjhm / mkdoctag
Last active February 5, 2017 00:03
semi automatic doc tagging for cdn.rawgit.com links
#! /bin/bash
#
# This script updates links in *.md files that look like
# https://cdn.rawgit.com/mygithub/myrepo/doctag201702041450/doc/some_doc.html
# to new timestamps and creates the corresponding git tags.
#
# Run it at root of the repo before checking in changes, and be sure to include `--tags` when you push to remotes.
#
@mjhm
mjhm / jade.md
Created March 29, 2014 03:26 — forked from passy/jade.md

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

@mjhm
mjhm / mongo_coll_update_test.js
Created January 22, 2013 04:18
This is a performance test of several methods of updating every item in 100000 row MongoDB collection. See comment below for results of test on a small EC2 instance.
#! /usr/bin/node
var MongoClient = require('mongodb').MongoClient
var Server = require('mongodb').Server;
var async = require('async');
var util = require('util');
// A simple linear congruence random number generator.
// This is anticipating doing a comparable test with the aggregation pipeline.
var randMod = 2 << 24;
@mjhm
mjhm / nodeJsServerProxy.js
Created August 1, 2011 02:31
node.js debug server proxy with automatic launching of a target file named "main.js" as a child.
var require;
var net = require("net");
var sys = require("sys");
var fs = require("fs");
var child_process = require("child_process");
var encoding = "binary";
var remote;
var main;