$ erlc -S test.erl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# there's probably a nicer way to do this, but anyway: | |
# path where to hold the last cwd | |
SUPER_CWD_FILE=/tmp/scwd | |
# store the cwd on each command | |
export PROMPT_COMMAND="pwd > $SUPER_CWD_FILE; $PROMPT_COMMAND" | |
# restore the cwd when starting a new shell | |
[ -r $SUPER_CWD_FILE ] && cd `cat $SUPER_CWD_FILE` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Byte calculator. Sums bytes of a given file and displays to screen. | |
* | |
* Compile: | |
* gcc ccalc.c -o ccalc -O2 | |
* | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Tooltip comes from: https://github.com/liliff/web/blob/master/_posts/2012-04-05-first-dive-into-lua-battery-widget.md | |
function rgbToHex(r, g, b) | |
return string.format("#%0.2X%0.2X%0.2X", r, g, b) | |
end | |
function chargeToColour(charge) | |
local unit = 255 / 100 | |
local amount = math.floor(unit * charge) | |
return rgbToHex(255 - amount, amount, 25) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### output of ./configure && make deps && make | |
checking whether necessary dependencies are already installed... | |
xmlm is installed in /usr/lib/ocaml/xmlm | |
ulex is installed in /usr/lib/ocaml/ulex | |
easy-format is installed in /usr/lib/ocaml/easy-format | |
mkdir -p /home/yfyf/sandbox/piqi/build/lib/ocaml | |
make -C deps | |
make[1]: Entering directory '/home/yfyf/sandbox/piqi/deps' | |
set -e; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.module example | |
.custom-field erlang-type-prefix | |
.erlang-type-prefix "" | |
.alias [ | |
.name itemid | |
.type uint32 | |
] | |
.record [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: Taylor Venable <[email protected]> | |
pkgname=piqi-git | |
pkgver=20131204 | |
pkgrel=1 | |
pkgdesc='A set of languages and open-source tools for working with structured data.' | |
arch=('i686' 'x86_64') | |
url='http://piqi.org/' | |
license=('Apache') | |
makedepends=('git' 'ocaml' 'ocaml-findlib' 'pandoc') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Requires openresolv. | |
# | |
# This file goes into | |
# | |
# /usr/share/openvpn/update-resolv-conf | |
# | |
# And this goes into your OpenVPN conf: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="generator" content="pandoc"> | |
<title></title> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="reveal.js/css/reveal.min.css"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- Prime sieve based on co-inductive streams | |
---- Taken from "Filters on coinductive streams, an application to | |
---- Eratosthenes’ sieve" by Yves Bertot | |
-- a 'stateful' filter | |
fm p n (x:xs) | (n < x) = fm p (n+p) (x:xs) | |
fm p n (x:xs) | (n == x) = fm p (n+p) xs | |
fm p n (x:xs) | (x < n) = x : (fm p n xs) | |
primes = sieve [2..] where |