Skip to content

Instantly share code, notes, and snippets.

View bmpvieira's full-sized avatar

Bruno Vieira bmpvieira

  • Lifebit
View GitHub Profile
@travisbhartwell
travisbhartwell / nix-shell-shebang.md
Last active March 29, 2024 19:55
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@max-mapper
max-mapper / readme.md
Last active August 29, 2015 14:18
dat beta design notes
  • dat data model
    • commit graph (mutable)
      • Merkle DAG
      • integrity check a root hash, and know all children are ok too (efficient!)
      • deduplication of common children
      • can content address all the nodes in the datastructure
      • can reveal single path from node to a root (with adjacent hashes) and prove object must be in dag
    • operation database (mutable)
      • protobufs in leveldb
  • prototbufs support efficient encodings and backwards compat
@rwaldron
rwaldron / normative.md
Last active August 29, 2015 14:18
ES6 is the same as ES2015
define run_fastqc
$$(addsuffix .ok,$(1)) : $(1)
mkdir -p $$(dir $$@) && \
unzip -p $$< $$(addsuffix .tmp_fastqc/fastqc_data.txt,$$(notdir $$<)) |\
grep ">>" | grep -v ">>END_MODULE" | cut -c 3- |\
awk -F ' ' 'BEGIN{N=0;} {if(($$$$1=="Basic Statistics" || $$$$1=="Per base sequence quality" || $$$$1=="Per base N content") && $$$$2=="pass" ) N++;} END { if(N>2) {print "__PASS__"}}' |\
grep __PASS__ && echo "FASTQC ok for $$<" > $$@
@vsbuffalo
vsbuffalo / unix-pipes.R
Created March 18, 2015 03:17
Yo dawg, I heard you like pipes, so I put a pipe in your pipe, so you can pipe streams while you pipe streams
library(magrittr)
write.table(iris, file="iris.txt", sep="\t", row.names=FALSE, quote=FALSE)
plines <- function(cmd) readLines(pipe(cmd))
ptabs <- function(cmd) read.delim(pipe(cmd))
# just as a trivial example, process some shuffled lines using GNU shuf, sort,
# etc. (we could do this in R, but this is to simulate command line operations)
@hadley
hadley / ds-training.md
Created March 13, 2015 18:49
My advise on what you need to do to become a data scientist...

If you were to give recommendations to your "little brother/sister" on things that they need to do to become a data scientist, what would those things be?

I think the "Data Science Venn Diagram" (http://drewconway.com/zia/2013/3/26/the-data-science-venn-diagram) is a great place to start. You need three things to be a good data scientist:

  • Statistical knowledge
  • Programming/hacking skills
  • Domain expertise

Statistical knowledge

var atomicQueue = require(...)
var queue = atomicQueue(db, function (data, cb) {
console.log('got some work', data)
// do stuff ...
cb(null, result) // if no error this work will be removed from the leveldb
})
// write will add this 'work' to the leveldb
queue.write({some: 'world'})
@audy
audy / fastash
Created January 29, 2015 19:45
#!/usr/bin/env node
var fs = require('fs');
var fasta = require('bionode-fasta');
var crypto = require('crypto');
fasta.obj('proteins.fasta').on('data', function(x) {
var seq = x.seq
.replace(/\*/g, '') // remove asterisks (stop codons)
.toUpperCase(); // enforce case
@ctb
ctb / quote.txt
Last active August 29, 2015 14:13
Michael Barton quote @Bioinformatics during #BaltiandBioinformatics
https://www.youtube.com/watch?x-yt-cl=84359240&x-yt-ts=1421782837&feature=player_embedded&v=ZACVcJt0oJA#t=7303
Kai Blin: If we containerize all these things won’t it just encourage
worse software development practices; right now developers still need
to consider someone other than themselves installing the software.
Michael Barton:
“It’s a good point. Ultimately, though, if I can get a container, and
it works, and I know it will work, do you care how well it was