Skip to content

Instantly share code, notes, and snippets.

View wavio.py
# wavio.py
# Author: Warren Weckesser
# License: BSD 3-Clause (http://opensource.org/licenses/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."""
View AnIntro.md

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
View INDArrayLearningRate.sc
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
TerrorJack / nvm-node-nightlies.md
Created Jun 7, 2018 — forked from chicoxyzzy/nvm-node-nightlies.md
Installing Node Nightlies via nvm
View nvm-node-nightlies.md

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

Install latest Node RC

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node

Install latest Node.js Nightly

NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
@TerrorJack
TerrorJack / !wasmllvm.md
Created Oct 4, 2018 — forked from yurydelendik/!wasmllvm.md
Using WebAssembly in LLVM
View !wasmllvm.md

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@TerrorJack
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
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443
@TerrorJack
TerrorJack / arm64.md
Created Dec 11, 2019 — forked from george-hawkins/arm64.md
Running virtualized x86_64 and emulated arm64 Ubuntu cloud images using QEMU
View arm64.md

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 https://cloud-images.ubuntu.com/releases/16.04/release/

Download the UEFI firmware image QEMU_EFI.fd from https://releases.linaro.org/components/kernel/uefi-linaro/latest/release/qemu64/

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

@TerrorJack
TerrorJack / git-move-files-in-subfolder.md
Created Dec 31, 2019 — forked from ajaegers/git-move-files-in-subfolder.md
Git: move files in an subfolder keeping history
View git-move-files-in-subfolder.md

Change structure of project folder with Git

I have this structure:

 project-folder/
     .git
     wp-admin/
     wp-content/
     wp-includes/
    .htaccess
You can’t perform that action at this time.