Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hraban
hraban / lisp-modules-lite.nix
Last active December 12, 2022 20:04
All-in-one first copy POC of lisp-modules-lite for posterity
# Copyright © 2022 Hraban Luyat
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
@hraban
hraban / mov2gif
Last active June 16, 2022 20:40
Convert a movie file to gif and copy its contents to clipboard
#!/usr/bin/env bash
# Convert a movie file to gif and copy its contents to clipboard.
#
# Technically: creates a .gif file in a temp dir and copies the path to
# clipboard, but that should be transparent.
set -euo pipefail
input="${1?Usage: $0 <input>}"
@hraban
hraban / README.md
Last active April 13, 2022 17:42 — forked from jamesmacfie/README.md
iTerm 2 - script to change theme depending on Mac OS dark mode
@hraban
hraban / mock-type-declaration.ts
Last active January 17, 2021 02:31
mock type declaration for untyped dependencies
// Don't want to bother creating types for an untyped dependency? Put
// this file anywhere in your codebase:
declare module 'third-party-module'
// You can add multiple lines, one for each module.
(defun n->r (n)
(let* ((band (isqrt n))
(bandstart (expt band 2))
(nextstart (expt (1+ band) 2)))
(list (min band (- n bandstart))
(min band (- nextstart n 1)))))
(defun init-rar (size)
(let ((ar (make-array (list size size))))
(dotimes (n (expt size 2))
@hraban
hraban / bookmarklet.js
Created August 27, 2020 08:28
Expand all resolved conversations on a GitHub PR
// create a bookmark with this value, or paste it directly in the address bar and press return
javascript:(() => {document.querySelector('[data-disable-with^=Loading]')?.click(); setTimeout(()=> document.querySelectorAll('.Details-content--closed').forEach(x => x.click()), 4000)})()
@hraban
hraban / a.org
Last active July 16, 2020 16:47
org-roam descriptive links

A for Apple

A is the first letter of the alphabet.

Next letter

The next letter is B for Botato

@hraban
hraban / keybase.md
Created April 10, 2020 11:11
keybase proof of identity

Keybase proof

I hereby claim:

  • I am hraban on github.
  • I am hraban (https://keybase.io/hraban) on keybase.
  • I have a public key whose fingerprint is 2FA4 04B2 9230 A243 E293 A121 45BC BB25 4655 96A6

To claim this, I am signing this object:

@hraban
hraban / dialog.html
Last active December 1, 2019 22:19 — forked from coinsandsteeldev/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<!DOCTYPE html>
<html>
<head>
<script>
// https://github.com/reaxis/mu
(function(d){"object"===typeof exports?module.exports=d():"function"===typeof define&&define.amd?define(d):mu=µ=d()})(function(){function d(){}function m(a){return a.replace(/-(.)/g,function(a,c){return c.toUpperCase()})}function k(a){return"[object Array]"==={}.toString.call(a)}function g(a){return[].slice.call(a)}d.one=function(a){return document.querySelector(a)};d.all=function(a){return g(document.querySelectorAll(a))};d.create=function(a){return document.createElement(a)};var h={one:function(a){return this.querySelector(a)},all:function(a){return g(this.querySelectorAll(a))},each:function(a){a.bind(this)(0);return this},"µAddEventListener":Node.prototype.addEventListener,addEventListener:function(){this.µEventCache=this.µEventCache||[];this.µEventCache.push(arguments);this.µAddEventListener.apply(this,arguments)},on:function(a,b){this.addEventListener(a,b);return this},add:function(){return g(arguments).reduce(function(a,b){k(b)?a.a
@hraban
hraban / index.css
Created November 21, 2019 10:52
halftone qr codes (backup of Lachlan Arthur's at http://jsfiddle.net/lachlan/r8qWV/ )
html, body {
height: 100%;
margin: 0;
}
body {
position: relative;
}
h1, h2 {