Skip to content

Instantly share code, notes, and snippets.


Paul Miller paulmillr

Block or report user

Report or block paulmillr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
paulmillr /
Created Aug 10, 2011
MongoDB sharding setup (quick & dirty)
#!/usr/bin/env zsh
# Change "Mongal" in text to name of your collection.
mkdir -p $DATADIR/db/{config,logs,0,1,2,3}
mkdir $DATADIR/backup
cd $DATADIR/db/logs
touch 0.log 1.log 2.log 3.log config.log main.log
chmod 666 *.log
paulmillr /
Last active Apr 24, 2020
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
paulmillr /
Created Sep 24, 2011
A plugin for Sublime Text 2 that replaces some symbols with their unicode equivalents.
# encoding: utf-8
import sublime
import sublime_plugin
class UnicodeTransformer(sublime_plugin.EventListener):
"""The transfrormer was tested with CoffeeScript code."""
_just_io = False # Determines if the file was just loaded / saved.
_is_saving = False
paulmillr /
Created Jan 20, 2012
ECMAScript 6 proxies fun (method missing, negative array indexes)
# Ruby’s “method missing” analog with ES6 proxies.
proxify = (object) ->
new Proxy object, get: (receiver, name) ->
object[name] ? object.methodMissing.bind object, name
object = proxify
a: 1,
b: 15,
c: ->
paulmillr / less.less
Created Mar 9, 2012
Sass vs Stylus vs LESS
View less.less
.border-radius (@radius) {
-webkit-border-radius: @radius;
-o-border-radius: @radius;
-moz-border-radius: @radius;
-ms-border-radius: @radius;
border-radius: @radius;
.user-list {
// need to use special `.` syntax
paulmillr / mapreduce.scala
Created Mar 10, 2012
Why functional programming matters (aka MapReduce for humans)
View mapreduce.scala
import com.cloudera.crunch._
import com.cloudera.scrunch._
class ScrunchWordCount {
def wordCount(inputFile: String, outputFile: String) = {
val pipeline = new Pipeline[ScrunchWordCount]
paulmillr / great_code.hs
Created May 4, 2012
Cool & pretty readable haskell code
View great_code.hs
data Cargo = Peasant
| Cabbage
| Wolf
| Goat
deriving (Eq, Enum, Show)
type ShoreState = [Cargo]
type Move = [Cargo]
type State = (ShoreState, ShoreState)
paulmillr /
Last active May 27, 2020
Most active GitHub users (by contributions).

Most active GitHub users (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

  .filter(user => user.followers > 1000)
paulmillr /
Created Jun 9, 2012
Add dashes to CoffeeScript source. toString ⇒ to-string. Issue #2370
fs = require 'fs'
# Usage: coffee src/**/*
replaceFile = (path) ->
fs.readFile path, (error, data) ->
return console.log error if error?
result = data
.replace /([a-z])([A-Z])([a-z])/g, ($0, $1, $2, $3) ->
paulmillr /
Created Jun 18, 2012
No-bullshit node.js profiler
microtime = require 'microtime'
global.profiler = profiler =
profilings: Object.create(null)
current: Object.create(null)
start: (name) ->
profiler.profilings[name] ?= 0
profiler.current[name] =
You can’t perform that action at this time.