Skip to content

Instantly share code, notes, and snippets.

View blahah's full-sized avatar

Rik Smith-Unna blahah

  • upward spiral ∞⟨X∴↯⟩∞
  • Bristol / Berlin / Nairobi
  • X @blahah404
View GitHub Profile
@blahah
blahah / ieee.js
Last active August 29, 2015 14:22
scrape ieee fulltext HTML by rendering in phantom
var webPage = require('webpage');
var fs = require('fs');
var page = webPage.create();
var urls = fs.read("fulltext_html_urls.txt").split("\n");
urls = urls.splice(0, urls.length - 1);
var ar_regex = /([0-9]+$)/;
console.log("scraping " + urls.length + " URLs");
@blahah
blahah / print_code.Rmd
Last active May 4, 2022 15:42
Print marked-up, unevaluated code from another file using Rmarkdown / knitr
---
title: "test"
author: "Richard Smith-Unna"
date: "21 May 2015"
output: html_document
---
Demo of reading an R file and dumping it raw into the HTML produced by knitr from RMarkdown, to get syntax highlighting.
Put the code you want to display in `import.R`.
@blahah
blahah / standalone_bg.sh
Created April 4, 2015 12:54
JBOSS WildFly standalone background launcher
#!/bin/sh
# this is a modified WildFly standalone startup script. It launches the
# server in the background, and instead of the script running until the server
# exits, the script runs until it receives a kill signal (leaving the server
# running in the background).
#
# This allows you to monitor the script output and decide when to kill it. For
# example if you wanted to only exit the script once the server has
# successfully launched, you could do:
@blahah
blahah / game.rb
Last active August 29, 2015 14:16
Genome assembly game - basic version
#! /usr/bin/env ruby
# This is a game that helps people understand genome assembly. Given a string,
# it generates sequence reads giving perfect coverage of the string and with a
# fixed overlap. The idea is to print the generated reads, cut them out, and
# have learners assemble them by hand. Different difficulties can be
# demonstrated by using a string with repeats, low complexity, etc., to mimic
# real assembly problems, or by adjusting the parameters (overlap and number
# of fragments).
@blahah
blahah / entry.json
Created January 3, 2015 16:32
proposed bibJSON format for ContentMine catalogue
{
"type": "article",
"publisher": {
"name": "Public Library of Science (PLoS)"
},
"journal": {
"issn": "1932-6203",
"name": "PLoS ONE",
"volume": "1",
"issue": "5",
@blahah
blahah / unix.md
Created November 25, 2014 08:35
Unix for biologists

Title: Unix Primer for Biologists Authors: Keith Bradnam & Ian Korf Date: September 27, 2012 Web: unixandperl.com Address: Genome Center, UC Davis, Davis, CA, 95616

Unix and Perl Primer for Biologists

Keith Bradnam & Ian Korf

@blahah
blahah / setup_contentmine.sh
Created October 1, 2014 12:38
ContentMine EBI workshop VM setup script
## ContentMine VM setup script
echo password | sudo -S apt-get update -y
## Java 7
sudo apt-get install -y openjdk-7-jdk
sudo update-alternatives --config java
sudo update-alternatives --config javac
@blahah
blahah / log.txt
Created September 10, 2014 17:13
ami2-poc run result
[WARNING] Assembly file: /home/vagrant/ami2-poc/target/ami2-poc-0.0.2-SNAPSHOT-bin is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment.
[INFO]
[INFO] --- jdeb:1.3:jdeb (default) @ ami2-poc ---
Downloading: http://repo.maven.apache.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava/10.0.1/guava-10.0.1.jar
Downloading: http://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar
Downloaded: http://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar (33 KB at 230.3 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar (0 B at 0.0 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/com/google/guava/guava/10.0.1/guava-10.0.1.jar (1467 KB at 2242.2 KB/sec)
[INFO] Creating debian package: /home/vagrant/ami2-poc/target/ami2-poc_0.0.2~SNAPSHOT_all.deb
@blahah
blahah / plots.Rmd
Created August 20, 2014 14:58
Basic plotting of transrate results for varying read depth Trinity mouse assemblies
Transrate assembly and contig plots.
========================================================
Assemblies of mouse with 10, 20, 50 and 100 million reads.
# Assembly-level stats
## Load data
```{r}
@blahah
blahah / .bashrc
Created August 19, 2014 23:08
bashrc pretty colours
set_prompt () {
Last_Command=$? # Must come first!
Blue='\[\e[01;34m\]'
White='\[\e[01;37m\]'
Red='\[\e[01;31m\]'
Green='\[\e[01;32m\]'
Reset='\[\e[00m\]'
FancyX='\342\234\227'
Checkmark='\342\234\223'