Skip to content

Instantly share code, notes, and snippets.

Avatar
🐙
タコ

Robin Schroer sulami

🐙
タコ
View GitHub Profile
View fix-elevation.py
"""
Fixes erroneous elevations in GPX tracks.
"""
import sys
import gpxpy
import gpxpy.gpx
file_name = sys.argv[1]
View 9.5 m4.2xlarge.json
[
{
"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
Check the Internet Connection
View internet-check.rkt
#!/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
Yabai config for vertical stacks
View .yabairc
# -*- 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 Apr 17, 2020
Jisho: Copy with Reading
View jisho-copy.user.js
// ==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 = " ";
View args.sh
~/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 Apr 4, 2020 — forked from alendit/call_printf.py
Call c `printf` from llvmlite
View call_printf.py
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 Aug 14, 2021
Alfred dc RPN Calculator Workflow Script
View dc.sh
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 Mar 22, 2020
Convert my markdown blog sources to org-mode
View md-to-org.rkt
#!/usr/bin/env racket
#lang racket
(require threading)
(define (complement f)
(λ args
(not (apply f args))))
View rejected proposals.yml
# Rejected alternatives for conditional workflow semantics
# 'explicit' key
# Pros:
# - Somewhat self-explanatory
#
# Rejected because:
# * Adds a special-purpose key to workflow which only serves to mark a workflow
# as "not run on receipt of a webhook".
# * Configgers cannot control workflows as groups. 'explicit' allows marking