Skip to content

Instantly share code, notes, and snippets.

View scemama's full-sized avatar
🏠
Working from home

Anthony Scemama scemama

🏠
Working from home
View GitHub Profile
@kif
kif / precision.ipynb
Created May 31, 2018 13:47
Bitshuffle/LZ4 and precision reduction
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active February 6, 2024 21:29
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@TApplencourt
TApplencourt / get_bibtex.sh
Last active August 29, 2015 14:24
From a isbn or a doi get the bibtex
#!/bin/bash
str_utilisation="$0 (doi|isbn) <value>"
if [ "$#" -ne 2 ];then
echo ${str_utilisation}
exit 1
fi
if [ "$1" == "doi" ];then
doi_raw=$2
@TApplencourt
TApplencourt / sqgite3.py
Last active April 24, 2017 16:20
SQGit : A workaround for binary support in git (who will not scale...)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
import sqlite3
except:
print "Sorry, you need sqlite3"
sys.exit(1)
@vext01
vext01 / vimura.md
Last active February 14, 2024 03:36
Vim+Zathura+Synctex

Vim+Zathura+Synctex

  • In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
@jboner
jboner / latency.txt
Last active May 9, 2024 20:15
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD