Skip to content

Instantly share code, notes, and snippets.

View zeroflag's full-sized avatar

Attila Magyar zeroflag

  • 🔥
View GitHub Profile
-module(palindrome).
-export([palindrome_check/1, server/1, serve/1]).
-export([server_of_clients/0, serve_client/0]).
-export([servers_of_clients/0,servers_balancer/3,many_serve_client/1]).
rem_punct(String) -> lists:filter(fun (Ch) ->
not(lists:member(Ch,"\"\'\t\n "))
end,
String).
@rob-smallshire
rob-smallshire / transducer.py
Last active August 29, 2015 14:06
Transducers à la Clojure in Python
"""Transducers in Python
http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
"""
from functools import reduce
def compose(*fs):
"""Compose functions right to left.
@lbruder
lbruder / lbForth.c
Created April 6, 2014 15:21
A minimal Forth compiler in ANSI C
/*******************************************************************************
*
* A minimal Forth compiler in C
* By Leif Bruder <leifbruder@gmail.com> http://defineanswer42.wordpress.com
* Release 2014-04-04
*
* Based on Richard W.M. Jones' excellent Jonesforth sources/tutorial
*
* PUBLIC DOMAIN
*
require 'socket'
module EventEmitter
def _callbacks
@_callbacks ||= Hash.new { |h, k| h[k] = [] }
end
def on(type, &blk)
_callbacks[type] << blk
self