Skip to content

Instantly share code, notes, and snippets.

View ngehlenborg's full-sized avatar
🧪
🍋➡️🥤

Nils Gehlenborg ngehlenborg

🧪
🍋➡️🥤
View GitHub Profile
@dialtone
dialtone / pivotal_to_github.py
Created September 23, 2011 00:48
Migrate from Pivotal Tracker to GitHub issues
import re
import sys
import csv
import json
import urllib2
from datetime import datetime
from collections import defaultdict as dd
@wouterj
wouterj / post.md
Last active July 13, 2021 02:00
How to use Jekyll, Plugins and Sass on GitHub Pages

How to use Jekyll, Plugins and Sass on GitHub Pages

Jekyll is a great CMS for developers and GitHub Pages is a great host to store your Jekyll sites. There is just one problem, GitHub runs Jekyll in safe mode, which means you can't use plugins. One thing you can do is building the Jekyll website locally and then push to GitHub.

Alexandre Rademaker found a solution to do this easially, which is quite usefull: "GitHub Pages and Jekyll plugins" After reading this I thought, that can be done easier!

Aliases to rescue

Git provides a way to have aliases of bash commands. You can do this by adding items to the alias key of your configuration. For this, you can add this locally by adding this lines to your %PROJECT_ROOT%/.git/config file:

@ngehlenborg
ngehlenborg / hex-to-rgba.js
Last active August 29, 2015 13:57
Hex color string to RGB values to create RGBA color
var hexToRgba = function( hexString, alpha ) {
alpha = alpha || 1;
var hexColor = parseInt( hexString.substring(1), 16 );
return ( 'rgba(' + ( ( hexColor << 8 ) >>> 24 ) + ',' + ( ( hexColor << 16 ) >>> 24 ) + ',' + ( ( hexColor << 24 ) >>> 24 ) + ',' + alpha + ')' );
}
@JakeConway
JakeConway / ICGC_Rest_API_to_UpSetR.R
Last active December 27, 2016 06:11
Pull mutation data from projects via the ICGC Rest API
require(jsonlite)
require(curl)
#An example of the function input.
#Specify the project name, fields, and number of entries(size) to pull in each list
data <- list(list(project = "THCA-US", fields = c("id", "mutation", "chromosome", "start", "end"), size = 6659),
list(project = "THCA-SA", fields = c("id", "mutation", "chromosome", "start", "end"), size = 45126),
list(project = "LUSC-US", fields = c("id", "mutation", "chromosome", "start", "end"), size = 65063),
list(project = "LUSC-KR", fields = c("id", "mutation", "chromosome", "start", "end"), size = 64671),
require(RISmed);
require(ggplot2);
makeJournalQuery <- function( journals ) {
query <- paste( "(" , paste( "\"", journals, "\"[Journal]", sep="", collapse=" OR " ), ")", sep="" );
return ( query );
}
queryPapers <- function( year, query, journals ) {
@flekschas
flekschas / rao-2014-gm12878-vs-k562-mbol-1kb-mres-telomeres-hipiler-v140.json
Last active December 5, 2019 21:17
HiPiler Example: Telomere contacts from Rao et al. (2014) GM12878 vs K562. Using "group by location" and switching to the "variance cover mode" one can compare the telomeres in both cell lines. See https://flekschas.github.io/hipiler/ for a live demo.
{
"fgm": {
"fragmentsServer": "//higlass.io/api/v1/",
"fragmentsPrecision": 2,
"fragmentsNoBalance": true,
"fragmentsDims": 60,
"fragmentsBaseRes": 1000,
"fragments": [
["chrom1", "start1", "end1", "strand1", "chrom2", "start2", "end2", "strand2", "dataset", "zoomOutLevel", "cell-line"],
["chr1", 0, 1, "coding", "chr2", 0, 1, "coding", "CQMd6V_cRw6iCI_-Unl3PQ", 6, "GM12878"],
@flekschas
flekschas / rao-2014-gm12878-mbol-1kb-mres-chr4-tads-hipiler-v140.json
Last active December 5, 2019 21:17
HiPiler Example: TAD calls of Arrowhead for chromosome 4 from Rao et al. (2014) GM12878. TADs are normalized to 60x60 bins to support piling, the diagonal is excluded for better of-diagonal patterns, and the matrix is capped at the 99-percentile against outliers. See https://flekschas.github.io/hipiler/ for a live demo.
{
"fgm": {
"fragmentsServer": "//higlass.io/api/v1/",
"fragmentsPrecision": 2,
"fragmentsDims": 60,
"fragmentsPadding": 50,
"fragmentsBaseRes": 1000,
"fragmentsPercentile": 99,
"fragmentsIgnoreDiags": 1,
"fragments": [