Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
@justinabrahms
justinabrahms / gist:6027925
Last active December 19, 2015 22:29
Node.js script which transforms old-style AMD modules into modules with the sugar syntax outlined in http://requirejs.org/docs/whyamd.html#sugar The code is ugly and procedural, but it solves a need. *NOTE*: This hasn't yet been validated to work. Specifically it doesn't provide a return statement which the requirejs documentation indicates it s…
#!/usr/bin/env node
/**
* Transforms code from old-style requirejs modules into AMD sugared modules.
*
* define(['dep1','dep2'], function(arg1, arg2) {...})
*
* becomes:
*
* define(function(require) { var arg1 = require('dep1'), arg2 = require('dep2'); ... });
*
@RobertAudi
RobertAudi / moc-on-osx.md
Last active June 8, 2025 08:45
This is a walkthrough on how to install the MOC command-line music player on OS X. The procedure was tested in Mountain Lion.

MOC on OS X

I waited for years for a Homebrew formula for MOC. I finally found one today, but it didn't work for me. So I decided to try to compile it from source.

Requirements

Here is a list of requirements, taken directly from the MOC README:

@jfdm
jfdm / xmonad-cheatsheet.tex
Created October 13, 2013 13:41
A simple xmonad cheatsheet.
\documentclass[pdftex, 12pt, a4paper, british, final]{article}
\usepackage[l2tabu,orthodox]{nag}
\usepackage{fixltx2e}
\usepackage{babel}
\usepackage[strict=true]{csquotes}
\usepackage{isodate}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[protrusion=true, expansion=true]{microtype}
@pid
pid / create-bootable-tails-usb-stick
Last active June 8, 2021 05:37
CREATE BOOTABLE TAILS USB-STICK https://tails.boum.org/ (OSX) Tails is a live operating system, that you can start on almost any computer from a DVD, USB stick, or SD card. It aims at preserving your privacy and anonymity, and helps you to: use the Internet anonymously and circumvent censorship; Alle Internet-Verbindungen werden zwingend durch d…
#!/usr/bin/env bash
###########################################################
# create bootable tails usb-stick https://tails.boum.org/ #
# !!! Read the comments !!! CHANGE <diskN> placeholder #
###########################################################
# get iso
wget http://dl.amnesia.boum.org/tails/stable/tails-i386-0.21/tails-i386-0.21.iso
@zackbloom
zackbloom / gist:7774909
Created December 3, 2013 18:36
Bookmarklet to run sortable.js (http://github.hubspot.com/sortable/docs/welcome/) on every table on the page
javascript:(function()%7B(function()%7Bvar%20a%2Cb%2Cc%2Cd%2Ce%2Cf%3Ba%3D%22table%5Bdata-sortable%5D%22%2Cc%3D%2F%5E-%3F%5B%C2%A3%24%C2%A4%5D%3F%5B%5Cd%2C.%5D%2B%25%3F%24%2F%2Cf%3D%2F%5E%5Cs%2B%7C%5Cs%2B%24%2Fg%2Ce%3D%22ontouchstart%22in%20document.documentElement%2Cb%3De%3F%22touchstart%22%3A%22click%22%2Cd%3D%7Binit%3Afunction(b)%7Bvar%20c%2Ce%2Cf%2Cg%2Ch%3Bfor(null%3D%3Db%26%26(b%3D%7B%7D)%2Cnull%3D%3Db.selector%26%26(b.selector%3Da)%2Ce%3Ddocument.querySelectorAll(b.selector)%2Ch%3D%5B%5D%2Cf%3D0%2Cg%3De.length%3Bg%3Ef%3Bf%2B%2B)c%3De%5Bf%5D%2Ch.push(d.initTable(c))%3Breturn%20h%7D%2CinitTable%3Afunction(a)%7Bvar%20b%2Cc%2Ce%2Cf%2Cg%3Bif(1%3D%3D%3Da.tHead.rows.length%26%26%22true%22!%3D%3Da.getAttribute(%22data-sortable-initialized%22))%7Bfor(a.setAttribute(%22data-sortable-initialized%22%2C%22true%22)%2Ce%3Da.querySelectorAll(%22th%22)%2Cb%3Df%3D0%2Cg%3De.length%3Bg%3Ef%3Bb%3D%2B%2Bf)c%3De%5Bb%5D%2C%22false%22!%3D%3Dc.getAttribute(%22data-sortable%22)%26%26d.setupClickableTH(a%2Cc%2Cb)%3Breturn%20a%7D%7D
@debasishg
debasishg / gist:8172796
Last active June 23, 2025 05:56
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t
;; Very quick hack to use `grasp` for searching js tokens in emacs.
;; Uses (compile) so when you get search results you can quickly step through them with (next-error) and (previous-error)
;; to install:
;; $ npm install -g grasp strip-ansi
(defun grasp-current-buffer (arg)
(interactive "MGrasp: ")
(compile (concat "grasp -H '" arg "' " (buffer-file-name) " | strip-ansi")))
@staltz
staltz / introrx.md
Last active July 22, 2025 08:36
The introduction to Reactive Programming you've been missing
@stfnhh
stfnhh / share.sh
Last active November 1, 2022 02:20
Command line interface for file.io
#!/bin/bash
WEEKS=0
ENCRYPTION=false
FILE=$1
usage() {
cat <<EOF
Usage: $0 FILE [options]
@Noitidart
Noitidart / _ff-addon-snippet-playSound.js
Created August 20, 2015 03:22
_ff-addon-snippet-playSound - Trying to use Audio API to play sound.
function audioContextCheck() {
if (typeof Services.appShell.hiddenDOMWindow.AudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.AudioContext();
} else if (typeof Services.appShell.hiddenDOMWindow.mozAudioContext !== 'undefined') {
return new Services.appShell.hiddenDOMWindow.mozAudioContext();
} else {
throw new Error('AudioContext not supported');
}
}