Skip to content

Instantly share code, notes, and snippets.

m-radzikowski /
Last active Dec 7, 2021
Minimal safe Bash script template - see the article with full description:
#!/usr/bin/env bash
set -Eeuo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
andy-thomason /
Created May 14, 2019
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

Efimero / project.clj
Created May 8, 2019
LWJGL3 example implemented in Clojure (linux)
View project.clj
(defproject test-3d "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url ""}
:dependencies [[org.clojure/clojure "1.10.0"]
[org.lwjgl/lwjgl "3.2.2"]
[org.lwjgl/lwjgl "3.2.2" :classifier "natives-linux"]
[org.lwjgl/lwjgl-opengl "3.2.2"]
[org.lwjgl/lwjgl-opengl "3.2.2" :classifier "natives-linux"]
import matplotlib.pyplot as plt
from PyQt5 import QtCore
import numpy as np
import time
import math
class VisualiseFrequency(QtCore.QThread):
def __init__(self, song, canvas, player):
pjstadig /
Last active Jun 8, 2021
The secret feature of transducers that no one talks about!

The Pledge

One thing that always made me a little sad about transducers was how map lost its ability to iterate multiple collections in parallel. This is actually my favorite feature of map. For example:

(map + (range 5) (range 5 10))
=> (5 7 9 11 13)

One somewhat practical use of this is if you want to compare two sequences, pairwise, using a comparator. Though I wish that every? took multiple collections, this is an adequate substitute:

ericnormand / 00_script.clj
Last active Nov 18, 2021
Boilerplate for running Clojure as a shebang script
View 00_script.clj
#_DEPS is same format as deps.edn. Multiline is okay.
{:deps {clj-time {:mvn/version "0.14.2"}}}
#_You can put other options here
holyjak /
Last active Apr 12, 2019
Script to monitor the usage of CPU, memory by a process via `top`
# Usage: ./ <PID of the process>
# Output: top.dat with lines such as `1539689171 305m 2.0`, i.e. unix time - memory with m/g suffix - CPU load in %
# To plot the output, see
export PID=$1
rm top.dat
while true; do top -p $PID -bMn 1 | egrep '^ *[0-9]+' | awk -v now=$(date +%s.%N) '{print now,$6,$9}' >> top.dat; done
elowy01 / BCFtools cheat sheet
Last active Dec 1, 2021
BCFtools cheat sheet
View BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
pvik /
Last active Oct 4, 2021
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.


C-M-f sp-forward-sexp
C-M-b sp-backward-sexp