Skip to content

Instantly share code, notes, and snippets.

View romanhaa's full-sized avatar

Roman Hillje romanhaa

View GitHub Profile
romanhaa /
Created December 31, 2023 13:37
Convert all subtitle tracks to SRT format, e.g. because Plex doesn't support ASS format
ffmpeg -i "<input.mkv>" -map 0 -c:v copy -c:a copy -c:s srt "<output.mkv>"
romanhaa /
Last active June 14, 2024 12:43
macOS settings
# reset with: defaults delete -g <FEATURE>
# dock
# position
defaults write "orientation" -string "right"
# icon size
defaults write "tilesize" -int "36"
romanhaa /
Created June 9, 2021 15:15
Highlight hits in `grep` search
grep --color=always -e "^" -e <SEARCH_TERM> <FILE>
romanhaa /
Last active June 4, 2021 07:56
Copy files/directories with `rsync`
# copy directory from A to B
rsync -ah --info=progress2 <DIR_SOURCE> <DIR_TARGET>
# copy directory from A into B
rsync -ah --info=progress2 <DIR_SOURCE> <PARENT_OF_DIR_TARGET>/
# copy content of directory A into B
rsync -ah --info=progress2 <DIR_SOURCE>/ <DIR_TARGET>/
# copy directory from A to B on remote machine
romanhaa /
Last active June 4, 2021 07:56
See colors in `less`
less -r <FILE>
romanhaa /
Last active June 4, 2021 07:56
Change formatting of text file, e.g. from ISO-8859-1 (table exported from Excel) to UTF-8
iconv -f ISO-8859-1 -t UTF-8 -o <OUTPUT_FILE> <INPUT_FILE>
romanhaa /
Last active February 27, 2020 14:01
# convert Docker container to Singularity format
singularity build cell_ranger_3.1.0.sif docker://romanhaa/cell_ranger:3.1.0
# create index for Cell Ranger
# - modify "/hpcnfs" to your file system
singularity exec --bind /hpcnfs cell_ranger_3.1.0.simg \
cellranger mkref \
--genome=cell_ranger_3.1.0 \
--fasta=GRCh38.primary_assembly.genome.fa \
--genes=gencode.v32.annotation.gtf \
romanhaa / alluvial.R
Last active February 13, 2020 17:37
Making an alluvial plot in R with ggalluvial
# original data
# every genomic bin of 200bp is assigned one of 8 possible chromatin states
# note that group1-3 are factors
# A tibble: 855,156 x 4
# bin group1 group2 group3
# <chr> <fct> <fct> <fct>
romanhaa / index.html
Created August 29, 2019 13:17
<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta http-equiv="Access-Control-Allow-Origin" content="*"/>
<meta charset="utf-8">
<script src=""></script>
romanhaa / index.html
Created March 18, 2018 09:51
<!doctype HTML>
<meta charset = 'utf-8'>
<script src='//' type='text/javascript'></script>
.rChart {
display: block;