Skip to content

Instantly share code, notes, and snippets.

@dsanson
dsanson / bibtex2markdown.rb
Created August 30, 2011 20:58
bibtex2markdown: a script for generating markdown formatted bibliographies from bibtex files using pandoc and citeproc
#!/usr/bin/env ruby
#
# This script is a wrapper around pandoc that uses pandoc's
# builtin citeproc support to generate a markdown bibliography
# from bibtex.
#
# Inspired by Jacob Barney's [bib2mkd][] script.
#
# [bib2mkd]: http://jmbarney.dyndns.org/?/linux/bib2mkd/
#
@gljeremy
gljeremy / disconnect.rb
Created September 21, 2011 14:03 — forked from tmcw/disconnect.rb
bulk-export run data from Garmin Connect
#!/usr/bin/env ruby
## disconnect
# ./disconnect.rb -u yourusername [-o /your/path] [-p yourhttpproxyserver]
#
# This is a command-line utility for the bulk-downloading of run data from
# the connect.garmin.com web application, which has lackluster export
# capabilities.
#
@mreid
mreid / INSTALL-VW-OSX.md
Created January 29, 2012 21:59
Install Vowpal Wabbit on Mac OS X Lion

The INSTALL instructions that come with Vowpal Wabbit appear not to work on Mac OS X Lion. Here's what I did to get it to compile. You will need the developer tools that come with the XCode installation.

The only dependency VW has is the boost C++ library. So first, download and install Boost

To install Boost, do the following:

$ cp ~/Downloads/boost_1_48_0.tar.bz2 ./
@kachok
kachok / turk.js
Created March 20, 2012 20:08 — forked from longouyang/turk.js
Small helper file for doing external HITs on Mechanical Turk
var turk = {};
(function() {
var param = function(url, name ) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
return ( results == null ) ? "" : results[1];
}
@jboner
jboner / latency.txt
Last active July 5, 2024 02:48
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MichaelBlume
MichaelBlume / check_writing.py
Created October 27, 2012 04:01
Beeminder writing check
#!/usr/bin/env python
import envoy
import requests
import time
r = envoy.run("find /Users/mike/Dropbox/writing | grep -v DS_Store | xargs wc -c")
count = r.std_out.split()[-2]
kb_written = int(count) // 1024
url = "https://www.beeminder.com/api/v1/users/mblume/goals/writing/datapoints.json"
@tvwerkhoven
tvwerkhoven / rsync_backup.sh
Last active July 5, 2023 05:30 — forked from necolas/rsync_backup
Improved script: - Check if run as root - Clarify rsync(1) flags - Add --inplace for performance, extra preservation flags - Check bless(8) target before setting Improved exclusion file: - Included files listed by Carbon Copy Cloner
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#
@johnmyleswhite
johnmyleswhite / JuliaGlobals
Last active August 10, 2018 10:58
Naively counting Pythagorean triples in Python and Julia
total = 0
N = 300
start_time = time()
for a in 0:(N - 1)
for b in 0:(N - 1)
for c in 0:(N - 1)
if a^2 + b^2 == c^2
total = total + 1
@noromanba
noromanba / crx-download.mkd
Last active November 27, 2023 03:46
download and locate Chrome Extension file 'crx'

Inspect crx location on Chrome Web Store

crx are src-file of Chrome Extension, those name like this;

novell-moonlight-3.99.0.3-i586.crx

find out *.crx URL and download

Bookmarklet

for Google Web Store

@joshdick
joshdick / forecast_snapshot.sh
Created October 10, 2013 14:31
Forecast.io Snapshot
#!/bin/sh
# Forecast.io Snapshot
#
# Creates a snapshot of forecast.io embeds (http://blog.forecast.io/forecast-embeds/)
# for display on the desktop via GeekTool/Nerdtool.
#
# by Josh Dick - http://joshdick.net
#
# This script depends on: