Skip to content

Instantly share code, notes, and snippets.

# Author: Warren Weckesser
# License: BSD 3-Clause (
import wave
import numpy as np
def _wav2array(nchannels, sampwidth, data):
"""data must be the string containing the bytes from the wav file."""

Basic unit type:

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

Basic functions:

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
import $ivy.`org.nd4j::nd4s:0.8.0`
import $ivy.`com.thoughtworks.deeplearning::plugins-indarrayweights:2.0.0-RC5`
import com.thoughtworks.deeplearning.plugins.INDArrayWeights
trait INDArrayLearningRate extends INDArrayWeights {
val learningRate: Double
trait INDArrayOptimizerApi extends super.INDArrayOptimizerApi { this: INDArrayOptimizer =>
View takehome-fp-interview.markdown

Take-home functional programming interview

This document is licensed CC0.

These are some questions to give a sense of what you know about FP. This is more of a gauge of what you know, it's not necessarily expected that a single person will breeze through all questions. For each question, give your answer if you know it, say how long it took you, and say whether it was 'trivial', 'easy', 'medium', 'hard', or 'I don't know'. Give your answers in Haskell for the questions that involve code.

Please be honest, as the interviewer may do some spot checking with similar questions. It's not going to look good if you report a question as being 'trivial' but a similar question completely stumps you.

Here's a bit more guidance on how to use these labels:

TerrorJack /
Created Jun 7, 2018 — forked from chicoxyzzy/
Installing Node Nightlies via nvm

You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR environment variable.

Install latest Node RC


Install latest Node.js Nightly

TerrorJack / !
Created Oct 4, 2018 — forked from yurydelendik/!
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
TerrorJack / haproxy.cfg
Created Oct 3, 2019 — forked from cmer/haproxy.cfg
Simple, no bullshit TCP port forwarding using HAProxy
View haproxy.cfg
listen l1
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1
TerrorJack /
Created Dec 11, 2019 — forked from george-hawkins/
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:

TerrorJack /
Created Dec 31, 2019 — forked from ajaegers/
Git: move files in an subfolder keeping history

Change structure of project folder with Git

I have this structure:

You can’t perform that action at this time.