Skip to content

Instantly share code, notes, and snippets.

View FMNSSun's full-sized avatar
🤪

Roman Müntener FMNSSun

🤪
View GitHub Profile
import bson
import datetime
import sys
import queue
import threading
import time
path = lambda x: x['path']
target = lambda x: x['target']
@FMNSSun
FMNSSun / arr2nljson.py
Last active April 12, 2016 13:50
Convert json array to newline separated
#
#- arr2nljson
# munt, 2016
#
# Reads in a JSON array and outputs new-line
# separated documents
#
#
import sys
@FMNSSun
FMNSSun / dfgen.hs
Created November 5, 2015 11:33
Program to generate Deadfish constants
import Data.List
import System.Environment
sqrti :: Int -> Int
sqrti = floor . sqrt . fromIntegral
squ :: Int -> Int
squ x = x * x
@FMNSSun
FMNSSun / postfix.hs
Created November 4, 2015 15:04
Interpreter for simple postfix expressions
import Data.List
import Data.Char
import System.Environment
isOp :: String -> Bool
isOp x = x `isInfixOf` "+-*/"
isInt :: String -> Bool
isInt ('-':x:xs) = isInt (x:xs)
@FMNSSun
FMNSSun / beam.py
Last active November 4, 2015 15:13
Beam interpreter in Pyhton
#!/usr/bin/python
import sys
if(len(sys.argv) < 5):
print 'Usage: ./beam.py path <debug> <debugpoints> <memsize>'
print ' debug: on or off'
print ' debugpoints: ;-seperated list of coordinates (e.g. 0,9;0,2)'
print ' (use -1,-1 for none)'
@FMNSSun
FMNSSun / eso.hs
Last active October 18, 2015 10:26
Simple esolang. Full source code for http://mroman.ch/impleso.html
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Combinator
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Token
import Data.Maybe
data Expression =
Loop [Expression]
| Literal Integer