Skip to content

Instantly share code, notes, and snippets.

View andrewyatz's full-sized avatar

Andrew Yates andrewyatz

  • EMBL-EBI
  • Cambridge, UK
View GitHub Profile
@jb-adams
jb-adams / TUTORIAL.md
Last active October 9, 2019 19:14
Reference sequences on AWS Tutorial

INSDC Reference Sequence Public Dataset Tutorial

The INSDC Reference Sequence Public Dataset enables access to biological reference sequences submitted to the INSDC, where sequences are identified according to checksum. The dataset includes both raw sequence as well as associated metadata.

Accessing Data

insdc-reference-sequences
|-- sequence
|   |-- 023e92ccde5f86f31ea0844a92dddb86
@hutattedonmyarm
hutattedonmyarm / RungapGPX.py
Last active October 17, 2023 08:48
Rungap for iOS exports GPS data as JSON file in the free version. This script converts it to GPX. Tested with python3.6. Might need to install required modules. Simply place either the metadata and data json files, or the complete zip file in the same directoryas the script and run it. Warning: Does barely any error checking
import xml.etree.cElementTree as ElementTree
import json, pytz, zipfile, unicodedata, re
from datetime import datetime
from os import listdir
from os.path import isfile, join
import glob
def slugify(value):
"""
Normalizes string, converts to lowercase, removes non-alpha characters.
@vicapow
vicapow / README.md
Last active December 17, 2019 11:15
An example of creating a PNG from an SVG in D3.

This is an example of creating a PNG from an SVG. (You should notice that you're able to right click on the last image and save it as a PNG image.) It has been Tested in Firefox and Chrome but doesn't work in Safari as of 2014-07-20.

Normally, you'll create your SVG in D3 but to make the example a bit more readable, the SVG is already placed in the document. There are a few important points. Namely:

  1. All the styles of the SVG need to be self contained in side of the <defs> tags. (These styles should be escaped using the <![[CDATA[ ... ]] tag.)
  2. The SVG needs to have the proper namespaces and document types.
  3. The SVG needs to be saved to an image, then read from an canvas element, then saved to an image again.

Note: Portions of this demo where taken from The New York Times' excellent Crowbar SVG extractor.

@captin411
captin411 / scat.sh
Created April 10, 2011 05:14
shell function to provide "smart concatenation" to switch between cat zcat and bzcat as needed
# "smart cat" -- and an awesome acronym
# shell function which will try and use
# zcat or bzcat on the filename if provided
# add to your .bash_profile or whatever
# example: scat file1.txt file2.gz file3.bz2 | grep "something useful"
scat()
{
for FILE in $@; do
MIME=$(file -bi $FILE)
case $MIME in

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: