Skip to content

Instantly share code, notes, and snippets.

@binoternary
binoternary / echo.py
Created December 4, 2016 18:25
Pipeable python script example
#! /usr/bin/env python3
# coding=utf-8
import sys
def main():
for line in sys.stdin:
process(line)
@binoternary
binoternary / csv_processing.py
Created December 4, 2016 17:52
Python csv example
#! /usr/bin/env python3
# coding=utf-8
import argparse
import csv
import datetime
import re
from collections import namedtuple
from os import listdir
from os.path import isfile, join
SELECT *
FROM ALL_SOURCE
WHERE UPPER(text) LIKE UPPER('%what_im_searching_for%')
ORDER BY type, name, line
;
@binoternary
binoternary / thompson_nfa.dot
Last active December 26, 2015 15:09
Graphviz code for the Thompson NFA of regular expression (aa|bb)*(aaa|bbb|c)*
digraph thompson_nfa {
rankdir = LR;
node [shape = circle, height = 0.5, fixedsize = true, fontsize = 14];
S_1 [label = "1"];
S_2 [label = "2"];
S_3 [label = "3"];
S_4 [label = "4"];
S_5 [label = "5"];