Skip to content

Instantly share code, notes, and snippets.

View sulami's full-sized avatar
🐙
タコ

Robin Schroer sulami

🐙
タコ
View GitHub Profile
@sulami
sulami / call_printf.py
Created April 4, 2020 11:55 — forked from alendit/call_printf.py
Call c `printf` from llvmlite
import llvmlite.ir as ir
import llvmlite.binding as llvm
from ctypes import CFUNCTYPE
def main():
m = ir.Module()
func_ty = ir.FunctionType(ir.VoidType(), [])
i32_ty = ir.IntType(32)
func = ir.Function(m, func_ty, name="printer")
~/build/lang $ cat tests/args.lisp
;; This tests that we can receive arguments passed to the binary.
(c/print_value argv)
(c/print_value "\n")
~/build/lang $ ./out foo bar baz
Nebula initalised.
(/Users/sulami/build/lang/out (foo (bar (baz nil))))
@sulami
sulami / jisho-copy.user.js
Created April 17, 2020 09:51
Jisho: Copy with Reading
// ==UserScript==
// @name Jisho.org copy with reading
// @namespace https://jisho.org/search/*
// @version 0.4
// @description Quickly copies a word with the reading to the clipboard
// @author Robin Schroer (originally Jace Sangco)
// @match https://jisho.org/search/*
// @grant none
// ==/UserScript==
var meaningSeperator = " ";
@sulami
sulami / internet-check.rkt
Last active May 28, 2020 18:23
Check the Internet Connection
#!/usr/bin/env racket
#lang racket
(require racket/date)
(require net/http-client)
(define (print-status now online [reason #f])
(if reason
(printf "date=~a online=~s reason=~s\n"
now
@sulami
sulami / 9.5 m4.2xlarge.json
Created February 1, 2021 16:08
DB benchmarks
[
{
"Plan": {
"Node Type": "ModifyTable",
"Operation": "Insert",
"Relation Name": "build_jobs",
"Alias": "build_jobs",
"Startup Cost": 0.00,
"Total Cost": 0.02,
"Plan Rows": 1,
@sulami
sulami / dc.sh
Last active August 14, 2021 17:43
Alfred dc RPN Calculator Workflow Script
query=$1
result=$( dc -e "$query pq" 2>&1 | tr -d '\\' | head -1 )
echo '{"items": ['
echo '{"title":'
echo "\"${result}\""
echo ','
echo '"subtitle": "Copy result to clipboard",'
echo '"arg":'
@sulami
sulami / frankenwm2bar.sh
Last active February 23, 2022 08:51
FrankenWM status scripts
#!/usr/bin/env sh
wm="frankenwm"
ff="/tmp/frankenwm.fifo"
[[ -p $ff ]] || mkfifo -m 600 "$ff"
# desktop names
ds=("1" "2" "3" "4" "5" "6" "7" "8" "9" "0")
# layout names
"""
Fixes erroneous elevations in GPX tracks.
"""
import sys
import gpxpy
import gpxpy.gpx
file_name = sys.argv[1]
@sulami
sulami / dickpics.md
Created July 30, 2015 22:05
Windows 10 Dick Pics

Dick Pics

and how Microsoft collects them. This follows John Oliver's approach to explain the NSA's data collection. All the quotes are verbatim from the Windows 10 installation and all these options are enabled by default. The button to even access the menus to deactivate this behavior is unnecessarily hidden.

Microsoft

Personalize your speech, typing, and inking input by sending contacts and

@sulami
sulami / .yabairc
Created May 13, 2020 12:59
Yabai config for vertical stacks
# -*- mode: sh -*-
# This implements automatic vertical stacking of windows in Yabai, like so:
# +------+ +---+--+ +---+--+
# | | | | | | | |
# | | => | | | => | +--+
# | | | | | | | |
# +------+ +---+--+ +---+--+
yabai -m config auto_balance off