This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Copyright (c) 2012 Bruno Vieira [http://bmpvieira.com] | |
#License: CC BY | |
#Short PCA example with FactoMineR and ggplot2 in R | |
library(FactoMineR) | |
library(ggplot2) | |
data = read.table("data.tsv", head=T, row.names=1) | |
pca = PCA(data[,2:ncol(data)], scale.unit=T, graph=F) | |
PC1 = pca$ind$coord[,1] | |
PC2 = pca$ind$coord[,2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
# | |
#Copyright (c) 2012 Bruno Vieira [http://bmpvieira.com] | |
#License: MIT | |
#Description: Simple R script to convert Long/Lat to UTM format | |
require("PBSmapping") || install.packages("PBSmapping", dependencies=TRUE) && require("PBSmapping") | |
input <- commandArgs(TRUE)[1] | |
coord <- read.csv(input, header = TRUE) | |
attr(coord, "projection") <- "LL" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
author: bmpvieira | |
license: WTFPL | |
description: Simple Youtube playlist parser using https://github.com/dominictarr/JSONStream | |
usage example: node youtubePlaylistParser.js PLt4dwg5cC5TSqHR44YK0UQ_8TSG8YtZtI | cclive -f best -c | |
*/ | |
var request = require('request'); | |
var JSONStream = require('JSONStream'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# getMycorLinks.coffee | |
# This script fetches all the sequences links from a MycorWeb Blast result. | |
# | |
# sequences can be fetched from these links with getMycorSequences.coffee: | |
# https://gist.github.com/4683075 | |
# results can be splitted into multiple files to run multiple instances of | |
# getMycorSequences.coffee | |
# | |
# Dependencies: casperjs | |
# Usage: casperjs getMycorLinks.coffee numberOutputFiles URL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# getMycorSequences.coffee | |
# This script fetches sequences from MycorWeb Blast result links. | |
# | |
# links file must be provided and can be obtained with getMycorLinks.coffee: | |
# https://gist.github.com/4683065 | |
# | |
# Dependencies: casperjs | |
# Usage: casperjs getMycorSequences.coffee fileWithLinks | |
# Example: casperjs getMycorSequences.coffee sequencesLinks:0-4275.txt | |
# Author: Bruno Vieira ([email protected]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# blastXMLtoJSON.coffee | 2013 Bruno Vieira [[email protected]] | |
# | |
# This script converts NCBI's Blast XML results to JSON | |
# | |
# For small files, it parses everything into a object in memory and | |
# writes the result to the output file in the end. | |
# For big files, it will write each Blast “Iteration” object separately, | |
# one per line, to avoid memory limits. | |
# | |
# Usage: coffee blastXMLtoJSON.coffee blast_results.xml output.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get '/watable', (req, res, next) -> | |
res.render 'watable' | |
app.get '/data.json', (req, res, next) -> | |
UserModel.find {}, 'email firstname lastname', (err, users) -> | |
return next err if err | |
rows = [] | |
for user in users | |
user = user.toObject() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Docker running natively in OSX connected to daemon running inside Vagrant | |
# | |
# This allows to use Docker natively in an OSX terminal, connected to a docker | |
# daemon running inside a CoreOS VM in Vagrant. Shared folder enabled through NFS. | |
# | |
# I tried to use [dvm](https://github.com/fnichol/dvm) but got issues with | |
# networking (#4) and shared folder (#7), so I just switched to CoreOS and | |
# added the settings for it to work like dvm. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shell = require("gl-now")({clearColor: [0,0,0,0]}) | |
var camera = require("game-shell-orbit-camera")(shell) | |
var createTileMap = require("gl-tile-map") | |
var ndarray = require("ndarray") | |
var terrain = require("isabella-texture-pack") | |
var createAOShader = require("ao-shader") | |
var glm = require("gl-matrix") | |
var createShader = require("gl-shader") | |
var createBuffer = require("gl-buffer") | |
var createVAO = require("gl-vao") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="IE=edge" http-equiv="X-UA-Compatible"> | |
<meta content="width=device-width, initial-scale=1" name="viewport"> | |
<title>DNAdigest</title> | |
<!-- Bootstrap --> |
OlderNewer