Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
flying-sheep / BSdownload.md
Created Dec 13, 2018 — forked from lh3/BSdownload.md
Download files from Illumina's BaseSpace
View BSdownload.md

References:

Steps:

  1. Follow steps 1-5 in the first link above to acquire access_token. This will take a while, but you only need to do this once. Never share this token!!
  2. Find the file you want to download. Copy the link, which looks something like: https://basespace.illumina.com/sample/9804795/files/tree/NA12878-L1_S1_L001_R1_001.fastq.gz?id=515013503. The "id" is the unique file identifier.
  3. Download the file with: wget -O filename 'https://api.basespace.illumina.com/v1pre3/files/{id}/content?access_token={token}', where {token} is from step 1 and {id} from step 2.
@flying-sheep
flying-sheep / userChrome.css
Last active Nov 8, 2018 — forked from isacikgoz/userChrome.css
A fix for firefox title bar buttons when you want them to be on the left hand side.
View userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* button box to the left */
#TabsToolbar { direction: rtl }
/* tabs ltr again */
#titlebar-content { direction: rtl }
/* buttons inverted */
#tabbrowser-tabs { direction: ltr }
/* keep these ltr */
#titlebar-max,
@flying-sheep
flying-sheep / PKGBUILD
Last active Sep 5, 2015 — forked from chmue/PKGBUILD
Updated PKGBUILD for r-studio-bin
View PKGBUILD
# Maintainer: Meow < a.li.devtty at gmail dot com >
# Get download links and md5 sums for latest version of RStudio desktop
cat <<_EOF_ >/dev/null
## R code #############
require(XML)
page = htmlTreeParse("http://www.rstudio.com/products/rstudio/download/",useInternalNodes = T)
links = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]'),xmlGetAttr,'href')
md5sums = sapply(getNodeSet(page,'//table[@class="downloads"]/thead/tr/th[text()="Installers"]/../../..//a[contains(@href,".deb")]/../..//code'),xmlValue)
print(cbind(links,md5sums))
View generate_graphs.py
import csv
from collections import Counter
from operator import itemgetter
from matplotlib import rcParams
import matplotlib.pyplot as plt
rcParams.update({'figure.autolayout': True})
answers_2013 = {"written_python2": (4660, 119),
@flying-sheep
flying-sheep / dabblet.css
Created Oct 11, 2012 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh, @LeaVerou, and @trueflyingsheep
View dabblet.css
/**
* Scrolling shadows by @kizmarh, @leaverou, and @trueflyingsheep
* Only works in browsers supporting background-attachment: local, CSS gradients, and masks
* Degrades gracefully
*/
html {
background: repeating-linear-gradient(45deg,
rgba(255,0,0,.1),
rgba(0,0,255,.1) 100px,
@flying-sheep
flying-sheep / assertion_hook.py
Created Aug 8, 2011 — forked from martinth/assertion_hook.py
A sample exception hook, that prints useful information if an AssertionError occures
View assertion_hook.py
#!/usr/bin/env python3
import sys, pprint
import os.path
# save old exception hook
sys._old_excepthook = sys.excepthook
def assert_hook(exc_type, exception, traceback):
if exc_type.__name__ == "AssertionError":
@flying-sheep
flying-sheep / mde_login.py
Created Aug 3, 2011 — forked from martinth/mde_login.py
mode.de login script
View mde_login.py
# -*- coding: utf-8 -*-
import cookielib
from urllib2 import HTTPCookieProcessor, build_opener
from urllib import urlencode
from BeautifulSoup import BeautifulSoup
# the login data
login_data = {
'login_username': u'USERNAME',
'login_password': u'PASSWORD',
You can’t perform that action at this time.