Skip to content

Instantly share code, notes, and snippets.

View romanhaa's full-sized avatar

Roman Hillje romanhaa

View GitHub Profile
@romanhaa
romanhaa / run.sh
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
romanhaa / run.sh
Last active June 14, 2024 12:43
macOS settings
# https://macos-defaults.com/
# https://www.defaults-write.com
# reset with: defaults delete -g <FEATURE>
# dock
# position
defaults write com.apple.dock "orientation" -string "right"
# icon size
defaults write com.apple.dock "tilesize" -int "36"
@romanhaa
romanhaa / run.sh
Created June 9, 2021 15:15
Highlight hits in `grep` search
grep --color=always -e "^" -e <SEARCH_TERM> <FILE>
@romanhaa
romanhaa / run.sh
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
romanhaa / run.sh
Last active June 4, 2021 07:56
See colors in `less`
less -r <FILE>
@romanhaa
romanhaa / run.sh
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
romanhaa / run.sh
Last active February 27, 2020 14:01
run_cell_ranger
# 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
romanhaa / alluvial.R
Last active February 13, 2020 17:37
Making an alluvial plot in R with ggalluvial
library("tidyverse")
library("ggalluvial")
# original data
# every genomic bin of 200bp is assigned one of 8 possible chromatin states
# note that group1-3 are factors
input_data
# A tibble: 855,156 x 4
# bin group1 group2 group3
# <chr> <fct> <fct> <fct>
@romanhaa
romanhaa / index.html
Created August 29, 2019 13:17
interactive_bar_chart_lol_leagues
<!DOCTYPE html>
<html>
<head>
<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="https://d3js.org/d3.v3.min.js"></script>
</head>
<style>
@romanhaa
romanhaa / index.html
Created March 18, 2018 09:51
Scatterplot
<!doctype HTML>
<meta charset = 'utf-8'>
<html>
<head>
<script src='//ramnathv.github.io/rCharts/libraries/widgets/polycharts/js/polychart2.standalone.js' type='text/javascript'></script>
<style>
.rChart {
display: block;