Skip to content

Instantly share code, notes, and snippets.

View sulami's full-sized avatar
🐙
タコ

Robin Schroer sulami

🐙
タコ
View GitHub Profile
@sulami
sulami / Cargo.toml
Created January 4, 2024 05:24
Extract Obsidian meeting notes from daily notes
[package]
name = "extract-meetings"
version = "0.1.0"
edition = "2021"
[dependencies]
anyhow = "1"
regex = "1"
"""
Fixes erroneous elevations in GPX tracks.
"""
import sys
import gpxpy
import gpxpy.gpx
file_name = sys.argv[1]
@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 / 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 / .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
@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 = " ";
~/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 / 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")
@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 / md-to-org.rkt
Last active March 22, 2020 10:13
Convert my markdown blog sources to org-mode
#!/usr/bin/env racket
#lang racket
(require threading)
(define (complement f)
(λ args
(not (apply f args))))