Skip to content

Instantly share code, notes, and snippets.

View seanlaidlaw's full-sized avatar

Sean LAIDLAW seanlaidlaw

View GitHub Profile
@seanlaidlaw
seanlaidlaw / README.md
Last active December 22, 2022 17:41 — forked from kentcdodds/README.md
Book Stitcher. Combine multiple mp3 files into a single MP3 file with metadata (for chapters etc.). It's great for audiobooks.

Book Stitcher

This is just something I hacked together to create an audiobook file out of CD audio files (complete with chapter marking metadata!)

Works great when used in combination with https://github.com/kentcdodds/podcastify-dir

npx https://gist.github.com/kentcdodds/e07f9106c63cc13a75adb0157700eb5b ./path-to-sorted-mp3s
@seanlaidlaw
seanlaidlaw / slingshot_pseudotime_example.R
Created June 23, 2020 09:49
Minimal working example for running Slingshot
library(Seurat)
library(slingshot)
library(RColorBrewer)
# start with a Seurat object containing assay of normalised cell counts, with a PCA or TSNE
# for example:
# > seuratobj
# An object of class Seurat
# features across 801 samples within 1 assay
@seanlaidlaw
seanlaidlaw / instapaper_bulk_delete_userscript.js
Created August 18, 2019 16:50
adds a "Bulk delete" button to instapaper to delete all 40 articles on current page. Requires confirmation before deleting.
// ==UserScript==
// @name Instapaper Bulk Delete
// @namespace https://www.instapaper.com/u
// @version 0.1
// @description Provides an option to bulk delete all articles on current page of instapaper
// @author Sean Laidlaw
// @match https://www.instapaper.com/u
// @grant none
// ==/UserScript==
@seanlaidlaw
seanlaidlaw / unpaywall
Created April 21, 2019 07:07
A morally ambiguous qutebrowser plugin for accessing academic papers either through the unpaywall.org API if a free copy exists in PMC, BioArxiv, etc. else through Sci-Hub
#!/usr/bin/env python3
"""
Qutebrowser userscript for finding a free version of first doi on webpage by using REST API of unpaywall.org.
"""
import requests
import json
import os
import sys
import re
@seanlaidlaw
seanlaidlaw / DGE tag extract
Created September 5, 2018 14:16
Extract DGE tag data from oriented fasta files. By default looks for CATG prefix and prints the 21 characters following it
#!/usr/bin/env python3
import re
import argparse
# Argument Parser
parser = argparse.ArgumentParser(description='Finds DGE tags from a multifasta')
parser.add_argument('-site',nargs="?",const="CATG",default="CATG",help='site the enzyme cuts at, by default CATG')
parser.add_argument('-length',nargs="?",type=int,const=21,default=21,help='length of tag to find, by default 21')
parser.add_argument('file', type=argparse.FileType('r'))
args = parser.parse_args()