Skip to content

Instantly share code, notes, and snippets.


Cheng Shao TerrorJack

View GitHub Profile
View stack.yaml
compiler-check: match-exact
resolver: ghc-
content-length: 112047972
sha1: 6a6e4c9c53c71cc84b6966a9f61948542fd2f15a
george-hawkins /
Last active Sep 2, 2020
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU

QEMU arm64 cloud server emulation

This is basically a rehash of an original post on CNXSoft - all credit (particularly for the Virtio device arguments used below) belongs to the author of that piece.

Download the latest uefi1.img image. E.g. ubuntu-16.04-server-cloudimg-arm64-uefi1.img from

Download the UEFI firmware image QEMU_EFI.fd from

Determine your current username and get your current ssh public key:

smeijer / parse-es6-template.js
Last active Aug 31, 2020
ES6 template string parser
View parse-es6-template.js
function get(path, obj, fb = `$\{${path}}`) {
return path.split('.').reduce((res, key) => res[key] || fb, obj);
function parseTpl(template, map, fallback) {
return template.replace(/\$\{.+?}/g, (match) => {
const path = match.substr(2, match.length - 3).trim();
return get(path, map, fallback);
View Printf.hs
{-# LANGUAGE GADTs, TypeInType, DataKinds, TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeApplications #-}
import GHC.TypeLits
import GHC.Types
import Data.Singletons
import Data.Singletons.Prelude
data Format = Lit Symbol | Str | Shown Type
Icelandjack /
Last active Sep 8, 2020
Type Classes and Constraints

Reddit discussion.

Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.

Disclaimer 2: I should tidy this up but probably won’t.

Disclaimer 3: Yeah called it, better to be realistic.

Type classes are a language of their own, this is an attempt to document features and give a name to them.

AndrasKovacs / STLC.hs
Last active Aug 14, 2016
Lambda calculus on the type level with GHC 7.11.20151212.
View STLC.hs
TypeInType, UndecidableInstances, TypeOperators, GADTs, TypeFamilies #-}
import Data.Kind
import GHC.Prim
import Data.Proxy
data Fun a b
type a ~> b = Fun a b -> Type
infixr 0 ~>
yurydelendik / !
Last active Sep 17, 2020
Using WebAssembly in LLVM
View !

NOTE: the content is out-of-date. All development is moved to the

Using WebAssembly in LLVM


# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
karpathy /
Last active Sep 25, 2020
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
chrisdone /
Last active Aug 21, 2020
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

You can’t perform that action at this time.