Skip to content

Instantly share code, notes, and snippets.

View ant1j's full-sized avatar

Antoine Jouanjean ant1j

View GitHub Profile
NATO_ALPHABET = {
'A': 'Alpha', 'B': 'Bravo', 'C': 'Charlie', 'D': 'Delta',
'E': 'Echo', 'F': 'Foxtrot', 'G': 'Golf', 'H': 'Hotel',
'I': 'India', 'J': 'Juliet', 'K': 'Kilo', 'L': 'Lima',
'M': 'Mike', 'N': 'November', 'O': 'Oscar', 'P': 'Papa',
'Q': 'Quebec', 'R': 'Romeo', 'S': 'Sierra', 'T': 'Tango',
'U': 'Uniform', 'V': 'Victor', 'W': 'Whiskey', 'X': 'X-ray',
'Y': 'Yankee', 'Z': 'Zulu',
'0': 'Zero', '1': 'One', '2': 'Two', '3': 'Three',
'4': 'Four', '5': 'Five', '6': 'Six', '7': 'Seven',
@ant1j
ant1j / quartile.R
Created September 7, 2016 13:03
Add a quantile column to a data.table
library(data.table)
setDT(temp)
temp[ , quartile := cut(value,
breaks = quantile(value, probs = seq(0, 1, by = 1/4)),
labels = 1:4, right = FALSE)]
@ant1j
ant1j / README.md
Created March 13, 2016 10:09
ColorBrewer2.org - color advices for cartography
@ant1j
ant1j / parallel.sh
Created November 19, 2015 16:40
Parallel
parallel --pipe --block 2M grep foo < bigfile
@ant1j
ant1j / coldistincts.awk
Last active August 29, 2015 14:24
Count disctinct values for each columns of a file with awk
BEGIN {
OFS = FS
}
NR == 1 {
n = split($0, headers, FS);
outfilename = FILENAME
sub(".csv", "", outfilename)