Skip to content

Instantly share code, notes, and snippets.

View hoelzro's full-sized avatar

Rob Hoelz hoelzro

View GitHub Profile
def ddb_unpack(item):
item |
with_entries({
key: .key,
value: (.value | to_entries[0] | if .key == "NULL" then
null
elif .key == "L" then
.value | map(ddb_unpack({key:.}).key) # XXX this sucks
elif .key == "M" then
ddb_unpack(.value)
package main
import (
"fmt"
)
func main() {
sliceOne := make([]byte, 10)
sliceTwo := sliceOne[0:5]
package main
import (
"bytes"
"crypto/aes"
"fmt"
"runtime"
"sync"
"time"
)
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw(say);
use experimental qw(signatures);
my $THRESHOLD = 8;
sub distance($a, $b) {
#include <stdio.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xmu/Atoms.h>
#define die(fmt, args...)\
fprintf(stderr, fmt "\n", ##args);\
exit(1)
@hoelzro
hoelzro / Makefile
Last active July 16, 2019 13:35
A stupid sampling profiler thing for Lua
CFLAGS += -fPIC
all: heatmap.so
%.so: %.o
gcc -shared -o $@ $^
clean:
rm -f *.o *.so
@hoelzro
hoelzro / remote.lua
Created May 22, 2019 01:55
Tweaked awful.remote that runs REPL expressions in a sandbox, preloads the awful module, and provides print that outputs via naughty notifications
---------------------------------------------------------------------------
--- Remote control module allowing usage of awesome-client.
--
-- @author Julien Danjou &lt;julien@danjou.info&gt;, with tweaks from Rob Hoelz
-- @copyright 2009 Julien Danjou
-- @module awful.remote
---------------------------------------------------------------------------
-- Grab environment we need
require("awful.dbus")
#!/bin/bash
set -e -u
EXTERNAL_SCREEN='DP-2-1'
INTERNAL_SCREEN='eDP-1'
# XXX persist windows & pids to a file in case things go *real* wrong?
DRY_RUN=${DRY_RUN:-0}
@hoelzro
hoelzro / Dockerfile
Last active May 18, 2019 17:52
Docker file for Sputnik wiki
FROM ubuntu
RUN apt-get update && apt-get install -y lua5.1 unzip build-essential luarocks
ADD sputnik-galaxy-12-07-12-all-in-one.zip /
WORKDIR /tmp
RUN unzip /sputnik-galaxy-12-07-12-all-in-one.zip
WORKDIR /tmp/sputnik-galaxy-12-07-12-all-in-one
RUN ./install.sh --lua-suffix=5.1 --without-readline