Skip to content

Instantly share code, notes, and snippets.

@mucbuc
mucbuc / README.md
Last active April 28, 2017 18:02
stateful text search

Its been a while since I've worked on my project ohm and I remember reading a blog about coding finite state machines with event emitters. So I did a little search and found this question, with interesting answer by Konrad Rudolph which sparked this fun little refactor.

Explicitly factoring out the states even further led me to this solution, which I don't claim to be an improvement. Use cases, drawbacks and advantages are beyond this scope, but do provide interesting conversation starters at cocktail parties, or job interviews.

This C++ implementation compiles and runs. I am not adding any build instructions because I don't feel that adds to the fun-ness of this problem but would gladly provide if wanted.

@mucbuc
mucbuc / test-bot-invoke.js
Last active March 31, 2017 19:14
test-bot-invoke
/*
Example of aws-lambda kicking off unit tests triggered by github commits. Amazon SNS
is used for integration with github
*/
'use strict';
const http = require( 'http' )
, ip = process.env.BOT_IP;

executing constructor

@mucbuc
mucbuc / jsfy.py
Last active December 18, 2015 15:09
idea for generating javascript code using python
#!/usr/bin/python
import sys
import copy
class Context(object):
dimensions = [ 'x', 'y', 'z' ]
class Scalar(object):
def __init__(self, name ):