Skip to content

Instantly share code, notes, and snippets.

View bmpvieira's full-sized avatar

Bruno Vieira bmpvieira

  • Portugal
View GitHub Profile
@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)
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 $$<" > $$@
@rwaldron
rwaldron / normative.md
Last active August 29, 2015 14:18
ES6 is the same as ES2015
@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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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.

@max-mapper
max-mapper / test.js
Last active August 29, 2015 14:24
tape + http local server test scaffolding
// the two testing modules I like
var test = require('tape')
var spawn = require('tape-spawn')
var execspawn = require('npm-execspawn') // can spawn from require() scope, check it out!
// put this in outer scope so we can kill the local server at the end
var server
test('start test server', function (t) {

advert said: "Titus will talk about the pros and cons of graduate school, how to choose if graduate school is a good fit for you, and tips for applying to graduate school"

see also:

https://www.netjeff.com/humor/item.cgi?file=GradSchoolOrHell

--

Grad school is very dependent on advisor, dept; talk to current grad students beforehand!

@rgbkrk
rgbkrk / jupyter-in-the-javascript-universe.md
Last active December 7, 2015 13:08
Jupyter in the JavaScript Universe

The Jupyter and IPython projects have been around more than 10 years and a lot has changed over the years in terms of frontend development: V8, Node, npm, transpilers, JS Compilers, competing module loading systems, auto-updating browsers, new frameworks, and many other bits. They've all come and made front end development much better. At the same time, they've bred complexity in choice and decisions. Some of the biggest warts have been the document API for the DOM, how we work on it, the tendency to get addicted to the ease of jQuery, and the resulting jQuery soup that gets created. Large projects have to make a choice on how they're going to package and ship components of their overall application.

There was a time at which I was comfortable in CoffeeScript. Now that I've read JavaScript the Good Parts, Node.js the Right Way, read and written [more](https://github.com/nteract/jupyter-sideca

// install node 4.2.2
function foo () {
console.log('----------------------------')
foo()
}
foo()