Skip to content

Instantly share code, notes, and snippets.

@codedot
codedot / Makefile
Last active April 16, 2024 07:08
Automated multi-currency market maker for Ripple
RIPPLE_LIB = node_modules/ripple-lib/package.json
all: hedge.js $(RIPPLE_LIB)
node hedge | tee latest.log | tee -a full.log
if grep -q "Offers submitted" latest.log; then \
$(MAKE) email; \
$(MAKE) trips; \
fi
$(RIPPLE_LIB):
@codedot
codedot / lambda.in
Last active September 29, 2023 08:37
Implementation of closed reduction with read-back mechanism using Interaction Nets Compiler
${
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *var(int fresh);
char *append(char *format, char *buf, char *str);
#define ABST(BUF, STR) append("%s%s: ", (BUF), (STR))
#define APPL(BUF, STR) append("%s%s ", (BUF), (STR))
@codedot
codedot / Makefile
Created March 31, 2011 11:03
Makefile to determine Shell subgrammars
RULES = \
complete_command \
list \
and_or \
pipeline \
pipe_sequence \
command \
compound_command \
compound_list \
term \
@codedot
codedot / ics2tc.awk
Last active September 12, 2021 21:20
Awk script that converts iCalendar .ics files to Time Clock "timelog" format by John Wiegley
function parse(dt)
{
Y = substr(dt, 1, 4);
M = substr(dt, 5, 2);
D = substr(dt, 7, 2);
h = substr(dt, 10, 2);
m = substr(dt, 12, 2);
s = substr(dt, 14, 2);
return Y "/" M "/" D " " h ":" m ":" s;
[server]
port_rpc_admin_local
port_peer
[port_rpc_admin_local]
port = 5005
ip = 127.0.0.1
admin = 127.0.0.1
protocol = http
@codedot
codedot / Makefile
Last active May 25, 2018 17:56
Optimal Talmudic Zigzag
URL = http://api.bitcoincharts.com/v1/csv/bitstampUSD.csv.gz
all: result.txt
time -p node simulate.js prices.json 0.25 9
result.txt: prices.json
time -p node optimize.js $< 100000 >|$@
prices.json: csv.gz
zcat $< | awk -F , -f zigzag.awk >|$@
@codedot
codedot / Makefile
Last active May 21, 2018 00:36
Bitcoin proof of work in pure lambda calculus
all:
node work2mlc.js getwork.json 381353fa >test.mlc
lambda -pem lib.mlc -f test.mlc
clean:
@codedot
codedot / Makefile
Last active February 13, 2018 22:40
Exhaustive search through MLC inputs
all:
npm install
time -p node generate.js 1 8 >terms.txt
time -p node compute.js abstract 250 1 5 >abstract.tsv
clean:
-rm -fr node_modules
-rm -f abstract.tsv terms.txt
@codedot
codedot / Makefile
Last active January 25, 2018 10:29
O(log(n)) Fibonacci in bc(1)
all:
bc fibo.bc <test.bc
echo 'fibo(123456)' | time -p bc fibo.bc >output.txt
cmp output.txt expected.txt
echo 'fibo(123456)' | time -p bc naive.bc >output.txt
cmp output.txt expected.txt
rm -f output.txt
clean:
-rm -f output.txt
@codedot
codedot / logo.svg
Created May 16, 2017 20:11
Codedot Logo in SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.