Skip to content

Instantly share code, notes, and snippets.

View joubertnel's full-sized avatar

Joubert Nel joubertnel

  • Netflix
  • Los Angeles, CA
View GitHub Profile
@joubertnel
joubertnel / gist:8411379
Last active January 3, 2016 04:49
denode
var fs = require('fs'),
jspipe = require('jspipe'),
Pipe = jspipe.Pipe,
job = jspipe.job,
filenames = ['file1.txt', 'file2.txt', 'file3.txt'];
function denode(fn, args) {
var pipe = new Pipe(),
newArgs = args instanceof Array ? args : [args];
@joubertnel
joubertnel / json-reformat.el
Last active December 25, 2015 23:49 — forked from gongo/json-reformat.el
changes indentation to 2 spaces
;;; json-reformat --- Reformat tool for JSON
;; Author: Wataru MIYAGUNI <gonngo@gmail.com>
;; Keywords: json
;; Copyright (c) 2012 Wataru MIYAGUNI
;;
;; MIT License
;;
;; Permission is hereby granted, free of charge, to any person obtaining
@joubertnel
joubertnel / gist:7023795
Last active December 25, 2015 18:49
Lazy parse a JavaScript class body
<html>
<body>
<div id="person1"></div>
<div id="person2"></div>
</body>
<script>
var util = {};
@joubertnel
joubertnel / gist:5218968
Last active December 15, 2015 06:49
serving up evented sexp from within emacs
(require 'elnode)
(elnode-start
(elnode-webserver-handler-maker "~/projects") :port 8001 :host "localhost")
@joubertnel
joubertnel / list_threads
Created January 25, 2013 20:24
List threads, including PID, TID, and priority
#!/bin/sh
# A (b)ash script replacement for ps showing threads and other helpful stuff.
# Especially useful for Busybox based systems which has a very simple ps applet
#
# License: GPLv2
# Copyright 2009 Chris Simmonds, 2net Ltd
# chris@2net.co.uk
show_details ()
@joubertnel
joubertnel / gist:1879611
Created February 21, 2012 22:53
enumerable invoke
theBalls.invoke('tick');
@joubertnel
joubertnel / gist:1879603
Created February 21, 2012 22:52
legacy invoke on enumerables
for (var i = 0, l = boxes.length; i < l; i++) {
boxes[i].tick();
}
@joubertnel
joubertnel / gist:1879588
Created February 21, 2012 22:49
string formatting
return 'top:%@px; left:%@px; background:rgb(0,0,%@);'.fmt(this.get('top'),
this.get('left'),
this.get('color'));
}.property('top', 'left', 'color'),
@joubertnel
joubertnel / gist:1879584
Created February 21, 2012 22:48
legacy string concat
style: function() {
return 'top: ' + this.get('top') + 'px; left: ' + this.get('left') +'px; background: rgb(0,0,' + this.get('color') + ');';
}.property('top', 'left', 'color')
@joubertnel
joubertnel / gist:1879577
Created February 21, 2012 22:47
succinct increment
var count = this.incrementProperty('count');