Skip to content

Instantly share code, notes, and snippets.

View tychoish's full-sized avatar

Sam Kleinman tychoish

View GitHub Profile
@zmagg
zmagg / 0201.md
Last active February 11, 2016 17:27
food diary, february. eating vegan, started february 2nd.
  • 1 egg, scrambled
  • 2 tomatoes fried lightly in a cast iron, with vinegar, and some chard & broccolini pieces
  • 1 white bass fish fillet (1/4 fish), panfried with panko bread coating
  • 9 oysters: fanny bay, kushu, kunamato (bc when possible, wa otherwise)
  • 1/4 lb of shrimp in butter and garlic, serious eats style
  • 1 espresso, 1 coffee
  • handful of dried cherries
  • half a backlava
  • half a pastel de nata
  • quarter bottle unoaked chardonnay
@epc
epc / inventory.py
Last active November 1, 2022 04:48
python script to parse sphinx objects.inv file
#!/usr/bin/env python
""" Process URL for intersphinx targets and emit html or text """
def validuri(string):
return string
from sphinx.ext.intersphinx import read_inventory_v2
from posixpath import join
import pprint
import argparse
@RedBeard0531
RedBeard0531 / functions.js
Created February 22, 2012 20:13
Min, Max, Sum, Count, Avg, and Std deviation using MongoDB MapReduce
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
;; emacsd-tile.el -- tiling windows for emacs
(defun swap-with (dir)
(interactive)
(let ((other-window (windmove-find-other-window dir)))
(when other-window
(let* ((this-window (selected-window))
(this-buffer (window-buffer this-window))
(other-buffer (window-buffer other-window))
(this-start (window-start this-window))