Skip to content

Instantly share code, notes, and snippets.

Avatar
🈁
λ

Ben Orchard raehik

🈁
λ
View GitHub Profile
View Tiff.hs
module Binrep.Example.Tiff where
import Binrep
import Binrep qualified as BR
import Binrep.Type.Common ( Endianness(..) )
import Binrep.Type.Int
import GHC.Generics ( Generic )
import Data.Data ( Typeable, Data )
@raehik
raehik / plfa-nats-bin-dec-recursion.agda
Created May 13, 2021
Beginner recursion problem from PLFA book
View plfa-nats-bin-dec-recursion.agda
module plfa.part1.NaturalsMWE where
data Bin : Set where
⟨⟩ : Bin
_O : Bin Bin
_I : Bin Bin
-- {-# TERMINATING #-}
dec : Bin -> Bin
dec ⟨⟩ = ⟨⟩
View download-and-parse.py
#!/usr/bin/python3
#
# Download the N2 vocab list and format it into an Anki-friendly CSV.
#
# A small number of formatting changes are made:
#
# * I prefer using "word" and "reading" fields rather than "kanji" and "kana",
# meaning words without kanji will have the kana in "word" and no "reading".
# This page does the opposite. I swap this round by swapping those fields if
# kanji is empty.
View keybase.md

Keybase proof

I hereby claim:

  • I am raehik on github.
  • I am raehik (https://keybase.io/raehik) on keybase.
  • I have a public key ASBEjCWwJ0PRlP4LljQ9G1xRXaPQFh4HP3NUpGDah81tmAo

To claim this, I am signing this object:

View bgm-creator.py
#!/usr/bin/env python3
#
# Create a 'BGM' track for a given 'main' track and merge them.
#
import sys
import os
import subprocess
import random
import argparse
View rtl-and-network.sh
#!/usr/bin/env bash
#
# Reload the rtl8723be driver and restart the Ubuntu network service.
#
driver="rtl8723be"
sudo modprobe -r "$driver" && sudo modprobe "$driver"
sudo service network-manager restart
View rtl-simple.sh
#!/usr/bin/env bash
#
# Reload the rtl8723be driver.
#
driver="rtl8723be"
sudo modprobe -r "$driver" && sudo modprobe "$driver"
@raehik
raehik / interfaces-example
Created Sep 25, 2013
Example /etc/network/interfaces file (adapted from my own on a (X)Ubuntu machine), created for a friend.
View interfaces-example
# interfaces(5) file used by ifup(8) and ifdown(8)
auto eth0 # BEN: automatically try to connect to eth0 (man ifup + ifdown)
iface eth0 inet static # BEN: eth0 is static
address 192.168.x.x # BEN: your own static IP
netmask 255.255.255.0 # BEN: likely this will be your netmask
network 192.168.x.0 # BEN: network you use with final octet as 0
broadcast 192.168.x.255 # BEN: probably this
gateway 192.168.1.1 # BEN: a.k.a. router
dns-nameservers 194.168.4.100 194.168.8.100 # BEN: the nameservers you use
# you use at home. Those