View Backup all repositories.md
  1. Create authentification token on github

  2. cd to somewhere with some space.

  3. The following

ACCESS_TOKEN=theSetOfLettersAndNumbersInGithubAuthentificationToken
curl -s "https://api.github.com/orgs/wurmlab/repos?page=1&per_page=100&type=private&access_token=$ACCESS_TOKEN" | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
View guess_the_genus.R
ants_fyi <- read.table("https://bit.ly/antsofuk")
colnames(ants_fyi) <- c("genus", "species")
nrow(ants_fyi)
head(ants_fyi)
play_guess_the_genus <- function() {
ants <- read.table("https://bit.ly/antsofuk")
colnames(ants) <- c("genus", "species")
score <- 0
attempts <- 0
View splitreads.sh
egrep '^@' in.fq | cut -f 1 -d ' ' | sort | uniq -c > in.fq.counts
cat in.fq.counts | egrep " 1 " | ruby -pe 'gsub(/ +1 @/, "")' > in.fq.orphan_ids
cat in.fq.counts | egrep " 2 " | ruby -pe 'gsub(/ +2 @/, "")' > in.fq.paired_ids
then subseq
View ants_gb.txt
# from https://en.wikipedia.org/wiki/List_of_ants_of_Great_Britain - unclear how reliable
Anergates atratulus
Camponotus sp.
Crematogaster scutellaris
Formica aquilonia
Formica cunicularia
Formica exsecta
Formica fusca
Formica lemani
Formica lugubris
View plotpcs.r
library(ggplot2)
plotPCs <- function(data=pcaOnIndividualQueenSamples, pcs=c(1,2), outputToScreen=TRUE) {
print(paste("running on:", deparse(substitute(pcaOnIndividualQueenSamples))))
library(ggplot2)
if (length(pcs) != 2) {
warning('must know which PCs to plot - give me 2!')
}
# if (outputToScreen) {
# yw$createDisplayDeviceIfNoneExists()
View gist:11fd350f8beb21889b59
#when discoveryd process is hogging CPU & domains aren't being resolved
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.discoveryd.plist
View gist:41eea6759d3e660ee5e2
# modified from : http://daisukeichikawa.blogspot.co.uk/2014/03/try-circlize-package.html
#########
library(circlize)
par(mar = c(1, 1, 1, 1))
factors = as.factor(c("scaffold1", "scaffold2"))
circos.par(points.overflow.warning = FALSE)
# initialize
View gist:65708e8593a31aac2ae9
bash <(curl -s https://gist.githubusercontent.com/yeban/df12d4ed1e624c64d023/raw/985ef241f69218aef41883e8cf30388830378f3c/ruby-setup.sh)
View gist:cc614329596566d06c1c
# installing ruby
wget -O ruby-install-0.4.3.tar.gz https://github.com/postmodern/ruby-install/archive/v0.4.3.tar.gz
tar -xzvf ruby-install-0.4.3.tar.gz
cd ruby-install-0.4.3/
sudo make install
ruby-install ruby
.rubies/2.1.3/bin/ruby
View units.R
install.packages('RUnit') # only once for the machien
library(RUnit) # every time R starts
d = function() { asdf( }
# Output: Error: unexpected '}' in "d = function() { asdf( }"
checkEquals(d(), 32)