Skip to content

Instantly share code, notes, and snippets.

Zack Dever zackdever

Block or report user

Report or block zackdever

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
zackdever / gist:dce4edd205ea12db89124a411859f329
Created Sep 12, 2016
racey results from clojure.core.memoize
View gist:dce4edd205ea12db89124a411859f329
(require '[clojure.core.memoize :as memo])
(defn calc [x] x)
(def memo-calc (memo/ttl calc {} :ttl/threshold 13))
(filter #(not= "ok" %)
(for [x (range 100000)]
(if (nil? (memo-calc "abc"))
(println "Result was nil!")
zackdever /
Last active Aug 29, 2015
unpack msgpack from stdin and print until stopped
#!/usr/bin/env python
import msgpack
import sys
while True:
line = sys.stdin.readline().strip('\n')
print msgpack.unpackb(line)
zackdever / gist:8701478
Created Jan 30, 2014
arc diff off another diff
View gist:8701478
taken directly from
Advanced topic: Dependent Phabricator reviews
Say you have an upstream called master, and a feature branch F1, and a second change that depends on F1, (call it F2).
git checkout master
git checkout -b F1
# work work
git commit -a
arc diff
View d3-paths.js
function r() {
return Math.random() * 100;
var lineData = function() {
return [
[0, r()],
[20, r()],
[40, r()],
[60, r()],
zackdever / html2csv.js
Created Apr 26, 2013
converts an html table to a csv string, and makes it available as a file download
View html2csv.js
function convertTableToCsv(tableSelector) {
return$(tableSelector + ' tr'), function(row) {
return$(row).find('th, td'), function(datum) {
return datum.textContent.replace(/,/g, '');
// to download
var data = convertTableToCsv('#mytable');
def debug_dict(self, debug_message, data_dict):
import logging
info = '%s\n' % debug_message
for k, v in sorted(data_dict.iteritems()):
info += '%s: %s\n' % (k, v)
zackdever / gist:5051462
Created Feb 27, 2013
make room for large numbers in nvd3.js charts
View gist:5051462
// may also need to make room on the chart itself, maybe something like:
// chart.margin({left: 10});'.nv-y.nv-axis > g').selectAll('g');
zackdever / alias
Created Feb 21, 2013
when creating an arc paste (, automatically copy the address to the cilpboard on os x
View alias
alias arcpaste='arc paste | copyarcpaste'
zackdever / imageFader.js
Created Oct 18, 2012
simple JavaScript image fader
View imageFader.js
var bgImgs = [
, '/images/bar.png'
, '/images/foobar.png'
$(function () {
if (bgImgs.length > 1) {
var bgImage = $('#bgImage')
, index = 0
You can’t perform that action at this time.