Skip to content

Instantly share code, notes, and snippets.

Avatar

falloutphil

  • UK
View GitHub Profile
@falloutphil
falloutphil / scheme-read-file-numbers.org
Last active Dec 28, 2021
Some ideas about how to efficiently read a file of numbers in scheme a la AoC
View scheme-read-file-numbers.org

To test we create a file much larger than we’d read in with a typical AoC question - let’s mimic day 11 of 2021 (also valid for day 09 too) available here.

shuf -i 1000000000-9999999999 -n 10000000 -o big_test.txt

With a file this big, my original solution runs out of memory due to garbage collection issues. The problem here was misunderstanding eager comprehensions - the nested map should be part of the list comprehension itself not applied afterwards!

A good link about comprehensions in Scheme for reference.

@falloutphil
falloutphil / 99-noto-mono-color-emoji.conf
Last active Jun 12, 2020 — forked from IgnoredAmbience/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
View 99-noto-mono-color-emoji.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration for KDE/Konsole
Konsole/KDE apps use QT rather than the GTK emoji setup. So standard Ubuntu setup doesn't seem to work.
https://bugs.launchpad.net/ubuntu/+source/kubuntu-meta/+bug/1767390
If you want the Snake emoji in your Python venv Powerline then see below!
@falloutphil
falloutphil / bindings.txt
Created Jan 11, 2020
Konsole Key Bindings for Emacs Terminal
View bindings.txt
To get windmove to work and stuff like this: https://ebzzry.io/en/emacs-pairs/
https://unix.stackexchange.com/questions/76566/where-do-i-find-a-list-of-terminal-key-codes-to-remap-shortcuts-in-bash
https://emacs.stackexchange.com/questions/977/shiftup-isnt-recognized-by-emacs-in-a-terminal/989#989
Settings -> Edit Current Profile -> Keyboard
But also check that it's not overridden in Settings -> Configure Shortcuts
S-Up \E[1;2A
@falloutphil
falloutphil / make-mega-adblock-hostsfile.sh
Last active Jan 5, 2020
Create Mega Adblock Hostsfile for use with Dnsmasq (Modified from Pi-hole)
View make-mega-adblock-hostsfile.sh
#!/bin/bash
# Modified Pi-hole script to generate a generic hosts file
# for use with dnsmasq's addn-hosts configuration
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh
# taken from: https://gist.github.com/chrisvella/5f3a18f1e442153cd685#file-make-mega-adblock-hostsfile-sh
# You can also get more blocks from:
# https://www.hostsfile.org/hosts.html
# Specifically:
# https://www.hostsfile.org/Downloads/BadHosts.unx.zip
View keybase.md

Keybase proof

I hereby claim:

  • I am falloutphil on github.
  • I am beadling (https://keybase.io/beadling) on keybase.
  • I have a public key ASCCElQg9BPs7FyCLB9hglmwpwjNUQrrFj-VvZtLLkFUaQo

To claim this, I am signing this object: