Skip to content

Instantly share code, notes, and snippets.

View alexanderankin's full-sized avatar

David Ankin alexanderankin

View GitHub Profile
@alexanderankin
alexanderankin / child.js
Last active December 27, 2020 19:25 — forked from jigewxy/child.js
node.js fork example --> parent/child process increment and interchange the count variable until >100
const fork = require('child_process').fork;
const child = fork(require('path').join(__dirname, 'grand-child.js'));
new Promise(r => child.once('message', r)).then(c => process.send(c));
child.on('exit', process.exit);
var count =Math.floor(Math.random()*100);
process.on('message', async (msg)=>{
console.log("CHILD: message received from parent process", msg);
@alexanderankin
alexanderankin / .sqliterc
Created October 19, 2019 17:14 — forked from quaertym/.sqliterc
sqlite run commands for pretty output of tables
.mode column
.headers ON
@alexanderankin
alexanderankin / curl_range.md
Last active March 9, 2017 19:01 — forked from mocchira/curl_range.md
HTTP GET with Range header by curl
# normal(explicitly specified start AND end)
curl -v -X GET -H "range: bytes=1-8" http://localhost:8080/bbb/test

# specified ONLY start(end will be specified at the end of file)
curl -v -X GET -H "range: bytes=10-" http://localhost:8080/bbb/test

# specified ONLY one negative value(last N bytes of file will be retrieved)
curl -v -X GET -H "range: bytes=-11" http://localhost:8080/bbb/test
# usage: `python ~/Desktop/contours.py 1994-654-12_v02.tif`
# output is to a squareless.txt file and the directory "out"
# Working well with thumbnails with 400px as their longest side - untested with other dimensions
# for i in $(ls -1 | grep tif); do python /Users/artsyinc/Documents/resistance/experiments/artwork_image_cropping/contours.py $i; done
import cv2
import numpy as np
from matplotlib import pyplot as plt
import sys