Skip to content

Instantly share code, notes, and snippets.

View tomisme's full-sized avatar
🌱
playing with frogs

Tom H. tomisme

🌱
playing with frogs
View GitHub Profile
# Boot from an Arch USB Drive
# Connect to the internet
wifi-menu
# Mount partitions
lsblk
mount /dev/nvme0n1p1 /mnt/boot
mount /dev/nvme0n1p2 /mnt
;; From e.g. https://github.com/scottjad/uteal
(defmacro dlet
"let with inspected bindings"
[bindings & body]
`(let [~@(mapcat (fn [[n v]]
(if (or (vector? n) (map? n))
[n v]
[n v '_ `(println (name '~n) ":" ~v)]))
(partition 2 bindings))]
~@body))
@tomisme
tomisme / get_available_namespaces.cljs
Created May 6, 2018 03:09
get available namespaces in clojurescript
; self-hosted env
(-> @cljs.env/*compiler* :cljs.analyzer/namespaces keys)
;; non-self-hosted env
(defmacro namespaces [] `'~(cljs.analyzer.api/all-ns))
type Constructor<T> = new (...args: any[]) => T;
const servicesMap = new Map();
servicesMap.set(ImsItemPanelService, imsItemPanelService);
servicesMap.set(OverviewService, overviewService);
servicesMap.set(HelpPanelService, helpPanelService);
export function getService<T>(ClassName: Constructor<T>): T {
return servicesMap.get(ClassName);

Keybase proof

I hereby claim:

  • I am tomisme on github.
  • I am tomisme (https://keybase.io/tomisme) on keybase.
  • I have a public key ASAit6TzgJM18CJAoU4STuv1-nHToC557iGm4-8bbACzkgo

To claim this, I am signing this object:

function resolveAfter2Seconds(x) {
return new Promise(resolve => {
setTimeout(() => {
resolve(x);
}, 2000);
});
}
async function add1(x) {
var a = resolveAfter2Seconds(20);
@tomisme
tomisme / git.sh
Last active February 17, 2017 12:09
# undo changes since last commit
git checkout <FILENAME> # . for all in current folder
# convert a spritesheet into individual files
convert bigset.png -crop 24x24 icon.png
@tomisme
tomisme / packages.sh
Last active February 17, 2017 12:07
arch package management commands (https://github.com/aurapm/aura)
# check for updates for installed (non AUR) packages
checkupdates
# update (non AUR) packages
aura -Syu
# update all installed AUR packags (after looking at diffs)
aura -Akua
# check diff / update single AUR package
@tomisme
tomisme / gpg.sh
Last active February 23, 2016 08:43
Handy gpg(1) commands
# encrypt message stored in a file and print to stdout
gpg -a -o - -r RECIPIENT -e INPUT_FILE
# decrypt message from clipboard
xclip -o | gpg -d
# import public/private keys from clipboard
xclip -o | gpg --import
# delete public key