Skip to content

Instantly share code, notes, and snippets.

Philip Jander janderit

  • Wunder Mobility, Jander.IT
  • Hamburg, Germany
View GitHub Profile
@ianbarber
ianbarber / simplepub.php
Created Jun 21, 2013
A noddy implementation of ZMTP 3.0 in PHP http://rfc.zeromq.org/spec:23
View simplepub.php
<?php
include_once "zmtp.php";
// This was connecting to a libzmq master based subscriber.
$host = "127.0.0.1";
$port = 4422;
// Connect and send null mechanism.
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$rc = socket_connect($socket, $host, $port);
@ckirkendall
ckirkendall / clojure-match.clj
Created Jun 15, 2012 — forked from bkyrlach/Expression.fs
Language Compare F#, Ocaml, Scala, Clojure, Ruby and Haskell - Simple AST example
View clojure-match.clj
(use '[clojure.core.match :only [match]])
(defn evaluate [env [sym x y]]
(match [sym]
['Number] x
['Add] (+ (evaluate env x) (evaluate env y))
['Multiply] (* (evaluate env x) (evaluate env y))
['Variable] (env x)))
(def environment {"a" 3, "b" 4, "c" 5})
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.