Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View wires's full-sized avatar
🕳️

Jelle Herold wires

🕳️
View GitHub Profile
@wires
wires / node-hash-functions.json
Created December 1, 2016 22:15
Listing of implemented hash functions in Node
[ "DSA",
"DSA-SHA",
"DSA-SHA1",
"DSA-SHA1-old",
"RSA-MD4",
"RSA-MD5",
"RSA-MDC2",
"RSA-RIPEMD160",
"RSA-SHA",
"RSA-SHA1",

SQLite as storage format? maybe not so crazy

  • we can write directly from pandas (with help of sqlalchemy)
import pandas as pd
from sqlalchemy import create_engine

df = pd.DataFrame({'a':[1,2,3], 'b':['x','y','z']})
@wires
wires / sync-lazy.js
Last active May 20, 2016 01:01
Lazy evaluation for synchronous JS function, 'memoization'
// synchronous lazy eval
// ES6
// function lazy (ev) { return x => this.cache = this.cache || ev(x) }
function Lazy(ev) {
return function (x) {
return this.cache = this.cache || ev(x)
}.bind(this)
}
@wires
wires / pickle_unpickle.py
Created December 8, 2015 16:33
Testing storage/loading of networkx graphs
from timeit import timeit
import pickle
from networkx.generators import fast_gnp_random_graph
from networkx.readwrite import json_graph
def create(N=1000):
# create some random graph
global G
G = fast_gnp_random_graph(N, 0.7)
@wires
wires / README.md
Created October 26, 2015 15:36
Elasticsearch + Highland streams

Elasticsearch and Highland streams

Example how to use Elasticsearch with highland streams

@wires
wires / my-service
Created October 19, 2015 10:47
minimal init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: <NAME>
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: <DESCRIPTION>
### END INIT INFO
var fs = require('fs')
var diff = require('diff-utility');
var f1 = '/tmp/diff-1'
var f2 = '/tmp/diff-2'
fs.writeFileSync(f1, "abcdef".split('').join('\n'))
fs.writeFileSync(f2, "cdefgh".split('').join('\n'))
diff(f1, f2, {stream: true}).ratelimit(1,1000).each(function(obj){
{"distance_table":[[0,30206,0,36651,0,13279,0,32380,0,12034,0,12283,0,41180,0,20602,0,35271,0,51101,0,45807,0,22371,0,27365,0,40789,40789,30206,40789,36651,40789,13279,40789,32380,1960982,1960982,1960982,1960982],[29170,0,29170,15583,29170,37178,29170,50285,29170,35919,29170,36620,29170,59085,29170,38507,29170,21171,29170,69006,29170,63712,29170,26939,29170,45902,29170,25115,25115,0,25115,15583,25115,37178,25115,50285,1942829,1942829,1942829,1942829],[0,30206,0,36651,0,13279,0,32380,0,12034,0,12283,0,41180,0,20602,0,35271,0,51101,0,45807,0,22371,0,27365,0,40789,40789,30206,40789,36651,40789,13279,40789,32380,1960982,1960982,1960982,1960982],[36468,15986,36468,0,36468,31574,36468,55820,36468,30853,36468,39965,36468,66946,36468,46368,36468,12548,36468,76867,36468,71573,36468,21335,36468,50326,36468,11309,11309,15986,11309,0,11309,31574,11309,55820,1932678,1932678,1932678,1932678],[0,30206,0,36651,0,13279,0,32380,0,12034,0,12283,0,41180,0,20602,0,35271,0,51101,0,45807,0,22371,0,27365,0,40789,40789,30206,40789,36
@wires
wires / ivotest.js
Created September 11, 2015 14:28
posting to transparantnl
var http = require('http')
var d = {
title: 'TblParlement Levend',
editor: 'Waag Society',
license: 'CC-BY',
description: 'Parlement Levend',
website: 'http://waag.org',
author: 'Waag',
id: 'fo'

Keybase proof

I hereby claim:

  • I am wires on github.
  • I am wires (https://keybase.io/wires) on keybase.
  • I have a public key whose fingerprint is 1124 72AA E064 3240 BA03 8B2B 4E2D 3ABE 1D30 C38D

To claim this, I am signing this object: