Skip to content

Instantly share code, notes, and snippets.

View terrymun's full-sized avatar
🏳️‍🌈
Happy Pride month!

Terry Mun-Andersen terrymun

🏳️‍🌈
Happy Pride month!
View GitHub Profile
@sheymann
sheymann / export_plot.R
Created April 16, 2012 16:01
R tip: Export a ggplot plot in PDF, EPS and PNG files
ExportPlot <- function(gplot, filename, width=2, height=1.5) {
# Export plot in PDF and EPS.
# Notice that A4: width=11.69, height=8.27
ggsave(paste(filename, '.pdf', sep=""), gplot, width = width, height = height)
postscript(file = paste(filename, '.eps', sep=""), width = width, height = height)
print(gplot)
dev.off()
png(file = paste(filename, '_.png', sep=""), width = width * 100, height = height * 100)
print(gplot)
dev.off()
@tony4d
tony4d / p4merge4git.md
Created August 24, 2012 19:00
Setup p4merge as a visual diff and merge tool for git
@bhasto
bhasto / Sony Bravia 2014.xml
Last active November 25, 2015 19:35
Plex Profile for Sony Bravia 2014
<?xml version="1.0" encoding="utf-8"?>
<Client name="Sony Bravia 2014">
<Identification>
<Header name="X-AV-Client-Info" regex=".*KDL-\d{2}[WR][5689]\d{2}B.*" />
<DeviceDescription>
<Manufacturer substring="Sony" />
<FriendlyName regex="KDL-\d{2}[WR][5689]\d{2}B.*" />
</DeviceDescription>
</Identification>
<DeviceDescription>
@danielecook
danielecook / fasta_sequence_lengths.sh
Last active February 22, 2017 10:40 — forked from maneeshi/gist:412ef98ab0fba2ac4d0c
Generate Fasta sequence lengths
cat file.fa | awk '$0 ~ ">" {print c; c=0;printf substr($0,2,100) "\t"; } $0 !~ ">" {c+=length($0);} END { print c; }'
@danielpquinn
danielpquinn / svg-rounded-rectangle-path.js
Last active June 4, 2024 07:01
Draw SVG Rounded Rectangle Path
/**
* Get path data for a rounded rectangle. Allows for different radius on each corner.
* @param {Number} w Width of rounded rectangle
* @param {Number} h Height of rounded rectangle
* @param {Number} tlr Top left corner radius
* @param {Number} trr Top right corner radius
* @param {Number} brr Bottom right corner radius
* @param {Number} blr Bottom left corner radius
* @return {String} Rounded rectangle SVG path data
*/
@macmanes
macmanes / sam_sambamba.md
Last active January 22, 2017 20:00
samtools v sambamba when streaming

About 12% faster streaming sambamba view/sort than if using samtools..

Going from 50M raw pe reads to a sorted BAM file in 15 minutes is pretty sweet.

samtools 1.2

bwa index -p index bwa.Trinity.fasta
@r-brown
r-brown / howto-install-jekyll_homebrew-rbenv.txt
Last active June 12, 2022 15:23
How to install Jekyll using Homebrew and rbenv
# install Homebrew
$ su ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# show brew commands
$ brew help
# check current user
$ echo $(whoami)
# grant access to the folders
@gt3
gt3 / customevent-polyfill.js
Last active March 1, 2022 11:50
custom event polyfill for IE 11 (>= 9 really)
// source: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
;(function() {
if (typeof window.CustomEvent === "function") return false
function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined }
var evt = document.createEvent("CustomEvent")
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)
return evt
}
@mehmetsefabalik
mehmetsefabalik / nginx-https-local.md
Last active July 10, 2024 08:59
Enable https on your local environment with nginx

enable https on your local environment

install mkcert and create certificates

brew install mkcert
mkcert -install