Skip to content

Instantly share code, notes, and snippets.

View duhaime's full-sized avatar

Douglas Duhaime duhaime

View GitHub Profile
@filipkral
filipkral / logging_to_sqlite_with_multiprocessing.py
Created October 26, 2016 12:46
Logging to SQLite with multiprocessing in Python
import sqlite3
from contextlib import closing
import multiprocessing
def prepare_db(db, tbl, col):
sql = "CREATE TABLE {0} ({1} text);".format(tbl, col)
with closing(sqlite3.connect(db)) as cnn:
cursor = cnn.cursor()
cursor.execute('DROP TABLE IF EXISTS {0};'.format(tbl))
cursor.execute(sql)
@ericsoco
ericsoco / .block
Last active November 22, 2018 19:53
cluster force
license: mit
@steveharoz
steveharoz / .block
Last active May 8, 2024 12:21 — forked from mbostock/.block
d3-force testing ground
license: gpl-3.0
height: 1030
scrolling: yes
@nvictus
nvictus / loadnpy.js
Last active November 4, 2023 18:47
NumPy binary file parser for javascript
// Client-side parser for .npy files
// See the specification: http://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
var NumpyLoader = (function () {
function asciiDecode(buf) {
return String.fromCharCode.apply(null, new Uint8Array(buf));
}
function readUint16LE(buffer) {
var view = new DataView(buffer);
var val = view.getUint8(0);
@prestojack
prestojack / .block
Last active May 15, 2019 17:42 — forked from dribnet/.block
Paper - Interactive Typeface
license: mit
@eyecatchup
eyecatchup / mr.robot_season-2_easter-egg-sites.md
Last active April 4, 2024 10:39
A collection of "Mr. Robot" Season 2 Easter Egg Sites. #mrrobot #hackingrobot #robotegg
@puzzler10
puzzler10 / README.md
Last active September 12, 2017 02:30
Dancing Madness

This was made as an example of how to add elements to a SVG container upon mouse-click. Click in the rectangle and see what happens!

See http://www.puzzlr.org/?p=46 for a more detailed explanation and walkthrough of the code.

@mbostock
mbostock / README.md
Last active September 21, 2017 11:37
Force Dragging II

This example demonstrates using d3.drag with d3.forceCollide to implement draggable circles with collision detection.

@BryanSchuetz
BryanSchuetz / concat.liquid
Created May 5, 2016 16:20
Concat arrays in Jekyll(liquid)
{% assign all_hosts = "" | split: "" %}
{% for host in site.data.shared_hosts %}
{% assign all_hosts = all_hosts | push: host %}
{% endfor %}
{% for host in site.data.paas_hosts %}
{% assign all_hosts = all_hosts | push: host %}
{% endfor %}