Skip to content

Instantly share code, notes, and snippets.

View radekstepan's full-sized avatar

Radek Stepan radekstepan

View GitHub Profile
[[PageOutline]]
The following items should be tested before each release. Be sure to vary the following:
* super | regular user
* logged in | out
* Firefox, IE 7/9, Chrome, Safari
* new | old user
= ACCOUNT =
@radekstepan
radekstepan / merge.coffee
Created September 8, 2013 12:35
merge pdfs together
fs = require 'fs'
path = require 'path'
async = require 'async'
{ exec } = require 'child_process'
outs = []
async.each ( file for file in fs.readdirSync('.') when path.extname(file) is '.pdf' ), (file, cb) ->
outs.push out = path.basename(file, '.pdf') + 'decrypted.pdf'
exec "qpdf #{file} #{out} --decrypt", cb
defmodule C do
def map([], _), do: []
def map([ head | tail ], func) do:
[ func.(head), map(tail, func) ]
end
def child(element, func, parent) do:
parent <- { self, func.(element) }
end
@radekstepan
radekstepan / pbackup.py
Created November 26, 2013 12:25
A backup script that uses the pbworks API to download all pages and files in a given wiki workspace.
#!/usr/bin/python
# -*- coding: utf -*-
import urllib2, json, datetime, os, unicodedata, re, codecs
from threading import Thread
API_KEY = '#'
WIKI = '#'
def slugify(value):
#!/usr/bin/env coffee
http = require 'http'
# Which mine?
mine = 'http://beta.flymine.org/beta'
# Replace multiple whitespace with a single space.
clean = (text) -> text.replace(/\s+/g, ' ')
# Get the services listing.
@radekstepan
radekstepan / organisms.diff
Created January 30, 2014 13:48
Shows an organisms dropdown on homepage list upload like on Lists page
diff --git a/intermine/web/main/src/org/intermine/web/struts/BeginAction.java b/intermine/web/main/src/org/intermine/web/struts/BeginAction.java
index b5a4979..477789e 100644
--- a/intermine/web/main/src/org/intermine/web/struts/BeginAction.java
+++ b/intermine/web/main/src/org/intermine/web/struts/BeginAction.java
@@ -18,6 +18,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Iterator;
@radekstepan
radekstepan / docker-install.sh
Last active January 19, 2024 10:13
Install Docker on Debian 7 Wheezy
#/bin/bash
if [ `getconf LONG_BIT` != 64 ]; then
exit 1
fi
sudo apt-get -y update
sudo apt-get -y install lxc wget bsdtar iptables curl golang git aufs-tools mercurial libdevmapper-dev
export GOPATH=~/usr/lib/go
// ==UserScript==
// @name DuoSkipper
// @description Skip test questions on Duolingo by pressing Enter.
// @include https://www.duolingo.com/practice
// @version 1.0
// ==/UserScript==
window.addEventListener('load', function() {
$(document).keypress(function(evt) {
if (evt.keyCode == 13) {
@radekstepan
radekstepan / gist:b3b4dad29e97f589928e
Created October 14, 2014 16:33
Edmonton communities and their locations
{
"data": [
{
"name": "Abbottsfield, Edmonton",
"type": "community",
"number": 2010,
"socrata_id": "q9gm-x3wv",
"lat": 53.5737301566926,
"lon": -113.38966126012794,
"zoom": 13
@radekstepan
radekstepan / events.js
Created October 20, 2014 16:01
Listening to events in Ractive
var test = require('tape');
var Ractive = require('ractive');
var _ = require('lodash');
var mediator = require('../src/js/app/modules/mediator.js');
test('mediator subscriptions get cancelled', function(t) {
var called = 0;