Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# This code was written by Krzysztof Kowalczyk (http://blog.kowalczyk.info)
# and is placed in public domain.
def v2fhelper(v, suff, version, weight):
parts = v.split(suff)
if 2 != len(parts):
return v
version[4] = weight
# BBEdit 12.6.2 update doesn't locate preferences in iCloud correctly.
# Create a symlink in `~/Library/Application Support` to resolve this.
rm -rf "${HOME}/Library/Application Support/BBEdit"
ln -s "${HOME}/Library/Mobile Documents/com~apple~CloudDocs/Application Support/BBEdit" "${HOME}/Library/Application Support/BBEdit"
@mjsteinbaugh
mjsteinbaugh / git-submodules.md
Created April 1, 2019 21:47 — forked from slavafomin/git-submodules.md
Git submodules best practices

Git submodules best practices

Useful commands

— Clone repository with submodules automatically:

git clone --recursive [email protected]:name/repo.git

— Initialize submodules after regular cloning:

# Fix detached head in a submodule
# Here's a good explanation on how to fix detached HEAD for submodules.
# https://stackoverflow.com/questions/18770545
git branch
git checkout master
git submodule add -b <branch> <repository> [<submodule-path>]
git branch --set-upstream-to=origin/master master
bcl2fastq --use-bases-mask y*,y*,y*,y* --mask-short-adapter-reads 0 --minimum-trimmed-read-length 0
@mjsteinbaugh
mjsteinbaugh / rmarkdown-template-issue.txt
Created March 18, 2019 19:31
R Markdown templates don't appear in viewer
https://bookdown.org/yihui/rmarkdown/document-templates.html
@mjsteinbaugh
mjsteinbaugh / travis-ci-callr-corrupt-error.txt
Created March 18, 2019 19:27
Travis CI failing due to corrupt callr.rdb file
Error in get0(oNam, envir = ns) :
lazy-load database '/home/travis/R/Library/callr/R/callr.rdb' is corrupt
Calls: <Anonymous> ... force -> rcmd_build_tools -> :: -> getExportedValue -> get0
In addition: Warning message:
In get0(oNam, envir = ns) : internal error -3 in R_decompress1
Execution halted
# Normalize a Windows file path from the clipboard.
#
# Single backslash is an escape character in R.
# Sanitize `\` to either `\\` or `/` (preferred).
#
# Otherwise, you'll hit this error:
# Error: '\p' is an unrecognized escape in character
#
# Note that this only works in R running on Windows.
# Linux/macOS R doesn't have the `readClipboard()` function.
@mjsteinbaugh
mjsteinbaugh / DEPRECATED-rcpp-mojave.txt
Last active April 7, 2019 13:16
Rcpp macOS Mojave header fix
Gist has moved to https://steinbaugh.com/posts/rbenv.html
@mjsteinbaugh
mjsteinbaugh / DEPRECATED-private-fork.md
Last active February 26, 2019 13:44 — forked from 0xjac/private_fork.md
Create a private fork of a public repository