Skip to content

Instantly share code, notes, and snippets.

View darach's full-sized avatar

Darach Ennis darach

  • Squircle Systems Ltd
  • London, UK
View GitHub Profile
@darach
darach / makeymakey-copter.js
Created September 16, 2013 20:16
NodeConf EU NodeCopter - Use EEP (Embedded Event Processing) and Beam (compute streams) to fly an AR Drone. Uses a makey makey (www.makeymakey.com) or keyboard as input
// Copyright © 2013 Darach Ennis. All rights reserved.
//
// Sample EEP/Beam AR drone integration.
// Works with keyboard
// Works with a makey makey - http://www.makeymakey.com/
// Coded during NodeConf EU but not demonstrated or tested ...
//
// Enjoy!
//
@darach
darach / numitron-counter.ino
Created December 23, 2013 22:21
Loop through 00 .. 99 with a pair of IV-16 numitron's
/*
* Pair of IV-16 Numitron's daisy chained on a pair of 74HC595 shift registers.
* This sketch simply counts from 00 to 99 repeatedly. Numitron's are wired as
* follows:
*
* +-f-+ 0b 00 00 00 00
* e a -> -d cg ef ba
* +-g-+
* d b
* +-c-+
@darach
darach / lps.es
Created July 2, 2014 11:03
ZMQ lazy pirate pattern - server - erlzmq2
#!/usr/bin/env escript
-module(lps).
-mode(compile).
-define(request_timeout,2500). %% msecs, (> 1000!)
-define(request_retries,3). %% before we abandon
-define(halt_strategy,die).
main(_Args) ->
@darach
darach / lpc.es
Created July 2, 2014 11:05
ZMQ lazy pirate pattern - client - erlzmq2
#!/usr/bin/env escript
-module(lpc).
-mode(compile).
-define(request_timeout,2500). %% msecs, (> 1000!)
-define(request_retries,3). %% before we abandon
-define(recv_timeout_enable,true).
-define(recv_timeout,2500). %% msecs
@darach
darach / Makefile
Last active August 29, 2015 14:05
0MQ Slow Joiner
CC = gcc
LD =
AR = ar
OBJS = zpub.o zsub.o
LIBS = -lzmq -lczmq -lwjelement -lwjreader #-lpthreads
CFLAGS = -Ideps/libzmq/include -Ideps/czmq/include -Ideps/wjelement/include -O2 -funroll-loops -g -std=c99 -pedantic -Wall -fPIC
LDFLAGS = -Ldeps/libzmq/src/.libs -Ldeps/czmq/src/.libs -Ldeps/wjelement/src/wjelement -Ldeps/wjelement/src/wjreader/
ARFLAGS =
zpub.o: zpub.c
rebar get-deps compile
==> cake (get-deps)
==> jch-erl (get-deps)
==> cake (compile)
==> jch-erl (compile)
Checking whether the PLT .plt is up-to-date... yes
Proceeding with analysis...
Unknown functions:
done in 0m0.42s
done (passed successfully)
@darach
darach / rt.sh
Created November 24, 2014 17:27
Rename git tags
#!/bin/bash
if [ $# -ne 2 ];
then
echo "usage: $0 <old> <new>";
exit 1
fi
old=$1
new=$2
@darach
darach / simple2.erl
Created March 24, 2015 12:21
Escript to show that how to have more than one histogram active at one time
#!/usr/bin/env escript
%%! -sname hdr_histogram_simple -pa ebin
%% H1
%% Memory Size 90184
%% Total Count 100
%% H2
%% Memory Size 90184
%% Total Count 1000
%% Done!
@darach
darach / keybase.md
Last active September 22, 2015 15:32
keybase.md

Keybase proof

I hereby claim:

  • I am darach on github.
  • I am darach (https://keybase.io/darach) on keybase.
  • I have a public key whose fingerprint is 164C B8BB DD67 02B3 394D 2F22 340E 536C BA3A D0C5

To claim this, I am signing this object:

@darach
darach / fony.sh
Last active February 15, 2021 20:36
Example showing how to compile pony executables via LLVM and clang from LLVM IR produced by 'ponyc -rir ...'
#!/bin/sh
LLVM_HOME=/usr/local/Cellar/llvm/3.6.2/bin
PONY_HOME=/path/to/pony/repo
PONY_LIBS=${PONY_HOME}/build/debug
TARGET_ARCH=x86-64
OUT_LL="$1.ll"
OUT_BC="$1.bc"
OUT_S="$1.s"