Skip to content

Instantly share code, notes, and snippets.

package main
// #include "lua.h"
// #include "lualib.h"
// #include "lauxlib.h"
// static int imgsize(lua_State *L)
// {
// char *path = luaL_checkstring(L, 1);
// char *err;
// GoUint w, h;
<!DOCTYPE html>
<style>
.domain {
display: none;
}
</style>
<svg width="960" height="500"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
@clofresh
clofresh / consul-incr.sh
Created May 17, 2017 01:10
atomic counter in consul
#!/bin/bash
KEY=$1
VAL=$2
MAX=${3-10}
if [ -z $KEY ]; then
echo "Must specify a key" >&2
exit 1
fi

Keybase proof

I hereby claim:

  • I am clofresh on github.
  • I am clofresh (https://keybase.io/clofresh) on keybase.
  • I have a public key ASAHFxEeutbD2NI1URA1nBLyjk8xg7rJnTuOsvxPPNOWnwo

To claim this, I am signing this object:

#!/bin/bash -e
if [ -z $1 ]; then
echo "Must specify a python requirement"
exit 1
fi
curdir=$(pwd)
dir=$(mktemp -d)
output="${curdir}/requirements.txt"
local V = require('vector')
local state = {idle = {}, pressed = {}}
local current = {
state = state.idle,
}
local lines = {}
local M = {
state = state,
current = current,
@clofresh
clofresh / PKGBUILD
Created May 22, 2015 02:14
iguana-ir
# Original PKGBUILD came from https://github.com/terazini/abs-htpc/iguana-ir
# Maintainer: Sterling Lombard <kb7jtz at arrl dot net>
# Contributor: Atanas Kunev <atanas dot kunev at gmail dot com>
pkgname=iguana-ir
pkgver=1.1.0
pkgrel=3
pkgdesc="IguanaWorks USB IR Transceiver driver, client and reflasher"
arch=('i686' 'x86_64')
found 16 partitions
partition 0
message set size of 161
offset 112357631, message size of 84
key size of -1
val size of 70
found 64 bytes of data
[[1085, 5514843, 4914, 1393542960.0, 0, None], [1085, 5514843, 4914, 1393542970.0, 10, None], [1085, 5514843, 4914, 1393542980.0, 20, None], [1085, 5514843, 4914, 1393542990.0, 30, None], [1085, 5514843, 4914, 1393543000.0, 40, None], [1085, 5514843, 4914, 1393543010.0, 50, None]]
partition 5
message set size of 161
-- Love debugging app for discovering joysticks
--
pressed = {}
function love.draw()
local x = 100
local y = 100
local dx = 12
local joysticks = love.joystick.getJoysticks()
#!/bin/bash
# Convert gzipped haproxy files to use date extensions
for f in $(ls haproxy*.gz | grep -v 2013)
do
dest="${f%.*.gz}-"$(gunzip -c $f | head -n 1 | awk '{ print $1 }' | cut -d T -f 1 | tr --delete '-')".gz"
mv "$f" "$dest"
done
# Convert and gzip the delayed files