Skip to content

Instantly share code, notes, and snippets.

@prologic
prologic / LearnGoIn5mins.md
Last active May 9, 2024 20:15
Learn Go in ~5mins
@andy-thomason
andy-thomason / Genomics_A_Programmers_Guide.md
Created May 14, 2019 13:32
Genomics a programmers introduction

Genomics - A programmer's guide.

Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.

https://www.genomicsplc.com

@bsmith89
bsmith89 / .gitattributes
Last active April 5, 2021 23:37
Example files for http://blog.byronjsmith.com/makefile-shortcuts.html, a default makefile for computational research projects
*.ipynb filter=dropoutput_jupyter
*.[tc]sv diff=daff-csv
*.[tc]sv merge=daff-csv
@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@klmr
klmr / Makefile
Last active March 21, 2024 19:55
Self-documenting makefiles
# Example makefile with some dummy rules
.PHONY: all
## Make ALL the things; this includes: building the target, testing it, and
## deploying to server.
all: test deploy
.PHONY: build
# No documentation; target will be omitted from help display
build:
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@kantale
kantale / karyoplot.py
Created March 2, 2015 00:17
Plot chromosome Ideograms with karyotype with matplotlib
import os
import matplotlib
from matplotlib.patches import Circle, Wedge, Polygon, Rectangle
from matplotlib.collections import PatchCollection
import matplotlib.pyplot as plt
def karyoplot(karyo_filename, metadata={}, part=1):
'''
To create a karyo_filename go to: http://genome.ucsc.edu/cgi-bin/hgTables
@jaseg
jaseg / gist:ef83d89b39ae69fad07a
Created July 23, 2014 23:54
Doing 3D projection in a few lines of python to render a rotating tetraeder to SVG
#!/usr/bin/env python3
import numpy as np
from math import sin, cos, pi, sqrt
import svgwrite
import itertools
def cam(f):
""" Returns a camera matrix for the given focal length """
return np.array(((1,0,0,0),
(0,1,0,0),
@swarminglogic
swarminglogic / watchfile.sh
Last active March 4, 2024 14:44
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@sillygwailo
sillygwailo / random-instapaper.js
Last active August 27, 2023 18:47
Random Instapaper Article Bookmarklet
// based on http://avoidtheinevitable.wordpress.com/2013/01/21/instapaper-random-article-bookmarklet/ updated to
// Instapaper's latest design. This only picks a random article from the first page of Instapaper items
javascript:var l=document.querySelectorAll(".article_item .article_inner_item .host a");l[Math.floor(1+Math.random()*l.length)].click();