Skip to content

Instantly share code, notes, and snippets.

View jezcope's full-sized avatar
🌱

Jez Cope jezcope

🌱
View GitHub Profile
@jezcope
jezcope / titleize-en-tags.rb
Created May 30, 2011 11:59
A short script to convert all my Evernote tags to titlecase.
require 'titleizer'
require 'appscript'
include Appscript
evernote = app('Evernote.app')
evernote.tags.get.each do |tag|
tag_name = tag.name.get
if tag_name[0] == tag_name[0].downcase

Useful tools related to testing

  • TestNG - test framework for Java
  • TestThat
    • test framework for R
  • Use mocks/stubs for isolating parts of your code in testing
    • Lots of mocking frameworks available (depends on your choice of language)
@jezcope
jezcope / list-repos.org
Last active August 29, 2015 14:19
Format a user's list of github repositories as Markdown links
import requests
from pprint import pprint as pp

USER='jezcope'
API_TOKEN='Get your own API token!'
GIT_API_URL='https://api.github.com'

r = requests.get(GIT_API_URL + "/users/datacarpentry/repos?per_page=100", auth=(USER, API_TOKEN))
@jezcope
jezcope / errors.txt
Created May 13, 2015 19:15
OpenRefine errors on Windows 7 running from a network share
13:58:34.143 [ refine_server] Starting Server bound to '127.0.0.1:333
3' (0ms)
13:58:34.196 [ refine_server] Initializing context: '/' from '\\<netw
ork path>\Data wrangling\openrefine-2.6-beta.1\webapp' (53ms)
13:58:39.001 [ refine_server] Failed to use jdatapath to detect user
data path: resorting to environment variables (4805ms)
13:58:39.003 [ refine_server] Failed to use jdatapath to detect user
data path: resorting to environment variables (2ms)
13:58:39.109 [ refine] Starting OpenRefine 2.6-beta.1 [TRUNK].
.. (106ms)
@jezcope
jezcope / rdm.opml
Created May 13, 2015 19:34
My research data management blog/news feeds
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Jez subscriptions in feedly Cloud</title>
</head>
<body>
<outline text="Research data management" title="Research data management">
<outline type="rss" text="data.bris" title="data.bris" xmlUrl="http://data.blogs.ilrt.org/feed/atom/" htmlUrl="http://data.bris.ac.uk"/>
<outline type="rss" text="The CMM for RDM Blog" title="The CMM for RDM Blog" xmlUrl="http://rdm.ischool.syr.edu/xwiki/bin/view/Blog/GlobalBlogRss?xpage=plain" htmlUrl="http://rdm.ischool.syr.edu/xwiki/bin/view/Main/WebHome"/>
logged: server *esup-server*, connection *esup-server* <127.0.0.1:40644>, message accept from 127.0.0.1
name: *esup-server* <127.0.0.1:40644>, sentinel: proc: *esup-server* <127.0.0.1:40644>, event open from 127.0.0.1
logged: server *esup-server*, connection *esup-server* <127.0.0.1:40646>, message accept from 127.0.0.1
name: *esup-server* <127.0.0.1:40646>, sentinel: proc: *esup-server* <127.0.0.1:40646>, event open from 127.0.0.1
Set information from port 40644 to be the log process
Set information from port 40646 to be the results process
@jezcope
jezcope / liber-abstract.org
Last active August 29, 2015 14:22
Abstract for LIBER 2015 conference

The missing piece: saving software for reproducible research

Jez Cope, Imperial College London/University of Sheffield, United Kingdom

Reproducibility has always been a central pillar of scientific research. The journal article is the gold standard in enabling this, describing the motivation, methods, results and conclusions of a piece of work. It is generally impossible to include the full underlying data within a paper, so authors instead make do with summaries, statistics and carefully-selected subsets. This approach makes it difficult to validate the conclusions of the paper, and to overcome this shortcoming there is increasing pressure on researchers to improve access to their underlying datasets.

However, the data is only half of the story. The calculations required to generate or analyse it are often too complex to give more than a general sketch in the methods section. When another researcher tries to reproduce the analysis, they quickly discover that there are many implementation details and e

@jezcope
jezcope / 0xA207F5C874416A0F.asc
Created July 11, 2015 17:53
My current public key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFWhTVYBEADNV7X9zsioS9/Ai1h2DDIg8A5qzVg74WZHjdD3FoVxyhUAdgs4
STigPw8R9HimpgTUD7OLs3MIQ2LUg8gr1p8FRDlTnhPFGVy/1l1yHhxpFpph8OOj
8uni27qI6i3uSFEJ5YDRJ9Z/8YgYT2Oe3sUkcLo2HLAV0whfJdLc/UKXN7Fz97Tz
0mTB71pgONtOJK3b16em8CxMygFnMJ/rR+brS/lVbaBTzB/KOubKhBavQA56ekql
Cewd4jHO6KjOtYsxaneX0F33V7yh4qX/vrgwZN0J7tuyoiuJHZ/cfwhpO+MBYPLL
tkEhJ1AEm/0L/kGUuispVlbk4p7NXBT96T70+LRQ8vkUCX4xLRmX4pa5uk3OmUfS
Xn/5y118Yq7T/AyqceiCsQxPBnX6Izd6XMUDE05CrqG2YTrNqr7QYT+SPZCSrSVE
1B58vFfnjzfM/kAbBfOub2x3OEi52fbk4C6ZdrJZZjKqBK+5CgIUCugT4A7OyXHA
@jezcope
jezcope / Figshare API search test.ipynb
Last active March 17, 2016 15:54
Searching the figshare API from Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# A minimalist workout generator:
#
# - No commandline options
# - All configuration and data in this file
import random
GROUPS = {
'Core front': [
'Crunches',