Skip to content

Instantly share code, notes, and snippets.

View finnp's full-sized avatar
🦆

Finn Pauls finnp

🦆
View GitHub Profile
👣👂🔥👂🎄🔦🐕👓🌐👍💯💯⛳️🐝🎲🐬🍀🍤👂🔦🔥🐝💼📖🚙🐝🐬💾💧🐬👣🐬🍀🌳👊🐝💼🐝👓🍰🍸🍟🍫📖💿👣🐈🍪💵👣🎲💧🍀⛵️🐔📚👑💿☁️🌳☕️💿🍫🎁🔦🚪💵🚗💎🎁🚧👓🍒🐄🐔💐📆💾👰🍪🔦💡🐝🚙🐝💵🐬🐕🍀🎁💾🍟🍒🔥🍩🔦🐝💼⛳️🐝🐊🌳☕️☕️📆📘🍪👢👢🌳🎄🎲👰💫📚🏁🚧🍩🎁💣💧🌍👢🍰🍸🚧🌍🏁👑☕️🍪🎳🐝💼🐝🍒👑💧🍩⛵️🍸👓🎬💣🐬👻👢🍫🔥👣🍬💵🎬☁️🌳🌍🚧👻🚪💎👂🚧🐈🐔🐈🔥🌐📆🎬🐄🏁💿💎📆🐄🎊🎊🍪💻🍟🚧🎲👢👊🚗🍤👑🚧📆🎬🏈🍫⛵️🍫🏈💿👰💧🎁🐸☁️👦🍪🎄🌍🍞🍬👂🎲👣🌳🍸📚💥🚧🐄🚪🐈🍀🏈🐈💥🎄🍟🎄🚗🍫🎄🌽👫💻⛵️🍤🏁🌽🍸🍩💐🍩🎳👏🐕🚗🔥👏👣🌍💐🍒📘💣🎬🍸🏁🌍☁️🌐📚🎁🌳🚗🌳☕️📆🔥🍬👏🐊👢🐸🎁🍫🏁👓🎁💎☁️🐄🚪🍩🍩🚪🌐👊💾💵📚🐫💧🍰🎬💫🏈👂💎⛵️🌳🐔🐬🎳🌐💐👦🍤💻🐬💫🎊📘👦🎊💫🍫🍀🍞🍸☁️💐🐔👢📆💐🏈🏈🏈🔦🎲🍒☁️🐸🍰📆👢🏁👣🐊💎🍟📘💣💵💧🐊⛵️📚🌳💎📖⛵️🍟👂💻🐄🍬🏁💎👦🐔🍸💧💻👏⛵️🚪⛵️💿🎊🐈🔥👏🍬🎬🌍🍒🎳👂⛵️💫👓💐☁️🚧🍞👂💣💎🔥🎲💻👓🎄💥💣🍞👏☕️🌳🎲🍤🏈👢🎄🎁💻🐫🍤🍪💵🎄💎🍫💻👑🐊👂🚗👏🍩💣🐊🍤💎👑🍟📖💾👦💻🍩👻🚗📖🌽🐈🚪💧🐔🔦📆👊🏈🚧🍀🍬👦👢🍩💣🐕🐔📚👣🚗🌍🚪🔥🚗💎🍬🍰⛵️🐬💾👂🍰📖🏈🏁👏🐸🍤💎🚪🏁👣🎄💿🚧🌽🌳💣🎊👓🚧🐊💧🍸🍰📚💵📖📚💵📆👣🍸💧🎊🐬👓💫👂💻💾🎳☕️💾📖⛵️🍟🍬🐬🎳🐔👦☁️⛵️👻👑📚🐔🐊👂💧🏁👢🍰🌍💥🌳🐬🏈🐔🚗🐊👢🍪🎁👻👑👰💐🍩👊📆🐕👏📚🌽🌽🏈📆🐄🎁🔦🐕🌍🐬👑🐊🐬💫🍫🐊🚧☁️🍪🍰🍩🎁👦🎲🌍👻🎁🍒💥📆👑🐊👫💧🌳🐬🍪🎳🎬💿🎄🐸🐫🍀🔥🐕📚💫⛵️☕️🍒🚧💵🍀👻🎬👣📘🌍🍰👣🍀💣👫☁️💧🏈🍪💻👓🎁💧💧👫🎁🍒🏁🐔🍤🔥🎳🍰🌳🍀🍪🍬🌽☕️👊🎳👢🐔👦🍀🐔🐝🍏🍏💯🔢💯💯🎩🐜🎮💤👽👾👐🔉🎅🌹📼💨❄️🐇🎳💈🅰☎️📻🐛🐖🌍🐧🔨💎🌼🍔🍰👔💦💬🎮🎅🐣🚌🍀🛀🍪🎈🍺🌐🔫🏆🐫📻🔧🏆🐣🙏🏆💔👊🍤⌚️🐈🔦⌛️🍗🐒🐧⭐️🍟🐈🎾🎻🎹🔫👤💨👤💩🐽🐂☎️🎻👅⌛️👕🎸❄️💼🚧💼🎷💨📌🐈🎤🚑⬆️🚿⛵️🐝💻⚓️🍪💀🍩☎️🍩👤🎷🔗👰💿💿⬅️🎄🍟🏊👢🍺👃💐⛵️🅰🌼👢💻🐴📢🐫💯🍪💢🍤🐾🍑💫📫🍫🍑🔉⛄️👻👰🐎🎲💵👾🎩🚨💔🍕🌹🎳🙏🍏💿🎷💧🐫🐴🐞🏀🐇🍃💉🐔💃🐂🔆📍🏁⬅️🚑🚪🏊💃🐔📌🔋⛔️🍒🍀👙👆👢🍐📢🍃💩👻🚪👃💉👉🐣❄️🎲🔫🐴🎱👽📼🔦🐔☁️💡🍤🐀💃🌙💃🚪👽🎥👐🚗💡🍬💀👫🎨💊🐫👻❄️🐍👎💍👙💤✈️🐚🚦🐨📖⛅️🍔📼✈️❄️💢🐛💊🏧🍐⌚️🐌🎲👜🌼🙏⛄️🍩🐾➡️🍀🎅👤🐺🔥💙👶🐙🏁👇🌹💿🐖🐬☎️📫👌💡🐕📫🍓🔫⚡️🌿👼💯💯💯🐖👎⛳️💼🐾⌚️⛵️👽📍🐨🎁👎💦🚗📫📼🎬🔦⚓️☎️👃🎭🍀🔫🐜🎅🐼💯
// convention for streams with ports
// object with two properties 'in' and 'out'
// 'in' is an object with keys as port names and values which are Writable streams
// 'out' is an object with keys as port and values which are Readable streams
// if the length of in- our outports is 1, 'in' and 'out' can be Readable or Writable streams directly
// if both the length of the in- and outports is 1, it's a Duplex stream
// through-like helper module
@finnp
finnp / 2.json
Last active August 29, 2015 14:23
[
{"type": "string", "position": 0, "name": "delimiter"}
{"type": "boolean", "position": 1, "key": "objectMode"}
]
@finnp
finnp / hw1.py
Last active August 29, 2015 14:21
def force_float(str):
try:
return float(str)
except (ValueError):
return 0.0
def rcp_poll_data(xml):
dom = web.Element(test_xml)
dates = [date.content for date in dom('series value')]
titles = {}
ctx.fillRect(10,10,100,200)
@finnp
finnp / nyancat.js
Last active June 10, 2017 17:48
nyancat in canvas
var catHeight = 150 // 150
var catOffset = 200
ctx.fillStyle = '#002E68'
ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height)
// rainbow
var rainbowColors = [
'#FF0000',
var EventEmitter = require('events').EventEmitter
// my current implementation
module.exports = function (obj) {
var calls = new EventEmitter()
for(methodName in obj) {
if (typeof obj[methodName] !== 'function') continue
var originalMethod = obj[methodName]
@finnp
finnp / umlautwords.js
Created October 30, 2014 22:30
Englisch Words that are also words in German if you replace all the appropriate vowels to umlaut (äöü).
var split = require('split')
var fs = require('fs')
var umlautwords = {}
function loadGermanWords() {
fs.createReadStream('./umlautwords.txt')
.pipe(split())
.on('data', function (word) {
word = word.toLowerCase()
{"a": 1, "b": 2}
{"a": 2, "b": 3}
{"a": 0, "b": 5}