Skip to content

Instantly share code, notes, and snippets.

View pjotrp's full-sized avatar
🚣‍♂️
Leaving github is harder than it should be

Pjotr Prins pjotrp

🚣‍♂️
Leaving github is harder than it should be
View GitHub Profile
case class Symbol()
case object Gap extends Symbol
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide
case object A extends Nucleotide
case object G extends Nucleotide
case object C extends Nucleotide
case object T extends Nucleotide
case object AnyGap
def splitSimplePass6[T >: Symbol](seq: List[T]): List[List[T]] = {
case class Symbol()
case object Gap extends Symbol
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide
case object A extends Nucleotide
case object G extends Nucleotide
case object C extends Nucleotide
case object T extends Nucleotide
@pjotrp
pjotrp / gist:2282903
Created April 2, 2012 11:44
Using BLAS/LAPACK/LINPACK from the D language
/**
The following example uses this function to calculate the matrix-vector product using
a blas/lapack routine:
/ 3 1 3 \ / -1 \
| 1 5 9 | * | -1 |.
\ 2 6 5 / \ 1 /
D2 version based on the C version at http://www.seehuhn.de/pages/linear
@pjotrp
pjotrp / gist:2282927
Created April 2, 2012 11:48
Calling into R (Rlib.so/Rlib.dylib) from the D programming language
/**
A minimal example to use the random number generator of R (calling into Rlib.so from D)
dmd test_rlib.d ; ./test_rlib
It is a copy of the C code I wrote for BioLib
Pjotr Prins, 2012
@pjotrp
pjotrp / convert.rb
Created September 30, 2011 09:36
Ruby snippet to convert Foxpro file to SQLite or MySQL
# Ruby script to convert Foxpro file to SQLite or MySQL
#
USE_SQLITE3 = false
require 'rubygems'
require 'dbf'
require 'active_record'
if USE_SQLITE3
@pjotrp
pjotrp / latency.txt
Created May 31, 2012 10:22 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@pjotrp
pjotrp / mruby.scm
Created December 13, 2018 01:15
GNU Guix package for mruby
(define-public mruby
(package
(name "mruby")
(version "2.0.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/mruby/mruby/archive/" version ".zip"))
(sha256
(base32
@pjotrp
pjotrp / gist:53c4ab2cdfb95b1466955d1b9d790f25
Created January 2, 2019 12:16
Output of a CWL workflow run from a GNU Guix container
/gnu/store/ik2j18y8gd370ndinna725c2ikldyh0r-cwltool-1.0.20181012180214/bin/.cwltool-real 1.0
Resolved 'Workflows/test-workflow.cwl' to 'file:///gnu/export/local/home/wrk/izip/git/opensource/cwl/hacchy1983-CWL-workflows/Workflows/test-workflow.cwl'
[workflow ] start
[workflow ] starting step trimPE
[step trimPE] start
[job trimPE] /tmp/ypu930v1$ java \
-jar \
/gnu/store/f09s746mp061ric48gdb1xaav9ki0b7q-trimmomatic-jar-0.38/lib/share/jar/trimmomatic-0.38.jar \
PE \
/tmp/tmpt5_80dad/stg2b137de8-6a7f-4ff7-882b-69a5f0ab4d61/small.ERR034597_1.fastq \
### Keybase proof
I hereby claim:
* I am pjotrp on github.
* I am pjotrp (https://keybase.io/pjotrp) on keybase.
* I have a public key ASD7kTur_ZppaDJ63LYDzsVXAxA096kY7-xaxy8oyPIn-wo
To claim this, I am signing this object:
@pjotrp
pjotrp / honeywell_set_temp.sh
Created October 10, 2020 16:13 — forked from NeoCat/honeywell_set_temp.sh
Set temperature of honeywell Wi-Fi thermostat by shell script
#!/bin/bash
# Usage: ./honeywell_settmp.sh [-c|-h|-o] [<temp(F)>|schedule]
# Example: ./honeywell_settmp.sh -h 72 # set HEAT: temp=72F
# ./honeywell_settmp.sh -c schedule # set COOL: follow shceduled temp
# ./honeywell_settmp.sh -o # turn system OFF
######## Settings ########
LOGIN="YOUR_MAIL_ADDRESS"
PASSWORD="YOUR_PASSWORD"