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 / 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 / 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 / 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 / jmir.json
Created June 14, 2015 20:33
jmir scraperjson scraper
{
"url": "www\\.jmir\\.org",
"elements": {
"publisher": {
"selector": "//meta[@name='citation_publisher']",
"attribute": "content"
},
"journal": {
"selector": "//meta[@name='citation_journal_title']",
"attribute": "content"
@blahah
blahah / gaaah.cc
Created June 19, 2015 23:06
libkhmer untraceable abort
#include "hashbits.hh"
#include "subset.hh"
#include <string>
#include <exception>
using namespace khmer;
using namespace std;
bool file_exists (const string& name) {
@blahah
blahah / less_wrong_reading.md
Last active August 29, 2015 14:26
Reading Less Wrong - the order in which I read LW, with very short summaries

I have wanted to dive into Less Wrong for a long while, and now that I finally have some time I am taking the plunge. I am recording the order in which I read articles here with some notes.

  1. About Less Wrong - has a lot of links to articles that sample the flavour of the whole site
  2. Your Intuitions Are Not Magic - very high level, short post that draws parallels between intuition and statistical methods, and arguing that we should be critical of our intuitions (and statistical tools). Interesting, but not particularly enlightening or useful.
  3. The Cognitive Science of Rationality - very good introduction to how understanding cognitive science can help make us better thinkers. Includes a very brief introduction rationality, reasoning errors, and tools for avoiding bias.
@blahah
blahah / project_idea.md
Last active August 29, 2015 14:27
Mozilla Science Fellowship project idea

The Mozilla Science Fellowship application asks:

What do you see as the opportunities for impact around open research at your university? Could you leverage this opportunity in a potential project?

The answer field allows 100 words, but here I develop my idea before condensing it for the application.

Long version: The Cambridge School of Open Science

Cambridge University is unusual in that most PhD students are not required to take any classes - they do research from day 1. There are optional classes offered that cover a small proportion of the skills needed to do research in the modern, open environment, but these are far from comprehensive and in particular do not cover most aspects of open science.

@blahah
blahah / README.md
Last active October 18, 2015 11:36 — forked from mbostock/.block
Bullet Charts

Designed by Stephen Few, a bullet chart “provides a rich display of data in a small space.” A variation on a bar chart, bullet charts compare a given quantitative measure (such as profit or revenue) against qualitative ranges (e.g., poor, satisfactory, good) and related markers (e.g., the same measure a year ago). Layout inspired by Stephen Few. Implementation based on work by Clint Ivy, Jamie Love of N-Squared Software and Jason Davies. The "update" button randomizes the values slightly to demonstrate transitions.

@blahah
blahah / keybase.md
Created November 12, 2015 18:24
keybase proof

Keybase proof

I hereby claim:

  • I am blahah on github.
  • I am blahah (https://keybase.io/blahah) on keybase.
  • I have a public key whose fingerprint is CAB4 0A1C 6299 A1C7 1A80 4FF6 7571 0934 02B0 C4F8

To claim this, I am signing this object: