Skip to content

Instantly share code, notes, and snippets.

View kim366's full-sized avatar

Kim Schmider kim366

  • Sydney
View GitHub Profile
@kim366
kim366 / init.el
Created January 5, 2024 14:12
Emacs org-mode automatically fetch link title
;; Adpated from https://gist.github.com/jmn/34cd4205fa30ccf83f94cb1bc0198f3f
;; Automatically fetch link description (C-c C-l) for link at point
(defun my/url-get-title (url &optional descr)
(with-temp-buffer
(url-insert-file-contents url)
(goto-char (point-min))
(search-forward-regexp (rx "<title>" (group (*? anything)) "</title>"))
(match-string 1)))
@kim366
kim366 / .xbindkeysrc
Created September 27, 2023 15:50
Custom Browser Back & Forward Buttons
# https://askubuntu.com/questions/455762/xbindkeys-wont-work-properly
"xset r off; xdotool keyup --window 0 XF86Calculator key --clearmodifiers --window 0 ctrl+shift+Tab; xset r on"
XF86Calculator
"xset r off; xdotool keyup --window 0 XF86HomePage key --clearmodifiers --window 0 ctrl+Tab; xset r on"
XF86HomePage
def apply_chunked(data, fn, dim):
"""
Some xarray operations, such as resample disregard the fact that the loaded data set is distributed via dask.
This function applies any such operation to each chunk individually.
Arguments:
data: the xarray.Dataset
fn: any unary function acting on an xarray.Dataset
dim: the dimension to split chunks across as str
"""
#!/bin/bash
cd $(dirname $0)
set -e
@kim366
kim366 / swizzle.jl
Last active January 23, 2022 13:11
GLSL vector Swizzling in Julia
macro swizzle(vec, components)
function index(component)
(component == 'x' || component == 'r') && return 1
(component == 'y' || component == 'g') && return 2
(component == 'z' || component == 'b') && return 3
(component == 'w' || component == 'a') && return 4
error("swizzling components must be one of x, y, z, w")
end
accesses = [Expr(:ref, :vec, index(component)) for component in string(components)]
{
"shell_cmd": "cd ${project_path} && odin build . -debug",
"file_regex": "^(..[^:]*)\\(([0-9]+):?([0-9]+)?\\):? (.*)$",
"selector": "source.odin"
}
package main
import "vendor:glfw"
import "core:math/linalg"
import "core:fmt"
import vk "vendor:vulkan"
import "core:dynlib"
instance: vk.Instance
{
"fullName": "English (Colemak-DH ISO)",
"name": "us-colemak_dh_iso",
"singletonKeys": [
[ "CapsLock", "Alt_L" ],
[ "Shift_L", "Backspace" ],
[ "Control_L", "Win_L" ],
[ "Win_L", "Control_L" ],
[ "Alt_L", "Shift_L" ],
[ "Alt_R", "Extend" ],
"scripts": {
"build": "spago build --purs-args \"--censor-codes=UserDefinedWarning\"",
"dev": "concurrently -rki \"pscid --censor-codes UserDefinedWarning\" \"parcel assets/index.html\"",
"test": "spago test --purs-args \"--censor-codes=UserDefinedWarning\"",
"serve": "http-server dist",
"bundle:build": "NODE_ENV=production spago build --purs-args '--codegen corefn'",
"bundle:dce": "NODE_ENV=production zephyr Main.main",
"bundle:parcel": "NODE_ENV=production parcel build assets/index.html --no-source-maps --log-level 4",
"bundle:prerender": "bash scripts/prerender.sh",
"bundle": "npm run bundle:build && npm run bundle:dce && npm run bundle:parcel && npm run bundle:prerender",
name: CI
on:
push:
branches-ignore:
- dist-preview
- dist
jobs:
build: