Skip to content

Instantly share code, notes, and snippets.

import re
import csv
re_degenerates = re.compile(r"[wsmkrybdhvn]")
def get_patterns(filename):
with open(filename) as f:
#lines = f.readlines()[2:] # the first two lines aren't data
lines = f.readlines()
for record in csv.reader(lines):
import re
import csv
re_degenerates = re.compile(r"[wsmkrybdhvn]")
def get_patterns(filename):
with open(filename) as f:
lines = f.readlines()[2:] # the first two lines aren't data
for record in csv.reader(lines):
index = record[0] # the first column is the pattern id

Keybase proof

I hereby claim:

  • I am hovissimo on github.
  • I am hovis (https://keybase.io/hovis) on keybase.
  • I have a public key whose fingerprint is 5BF2 5C94 C3DE 8B11 09CA 5784 16B8 1A24 21E3 B5F1

To claim this, I am signing this object:

@hovissimo
hovissimo / Magic Gate
Created August 11, 2014 01:55
Magic Gate function for Node-RED, it let's you repeat messages arbitrarily
/* This function node will store the last message it
received as long as msg.payload != "abracadabra".
If this function receives a msg where the payload
exactly equals "abracadabra" then the stored
message will be forwarded.
This function is designed for storing and replaying
messages to help in testing flows. You can use it
by wiring up between two nodes where you want to
control or repeat messages, and also adding an
@hovissimo
hovissimo / node-red
Last active August 29, 2015 14:04 — forked from bigmonkeyboy/README.md
#! /bin/sh
# Starts and stops Node-RED
# /etc/init.d/node-red
### BEGIN INIT INFO
# Provides: node-red
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Node-RED initialisation