Skip to content

Instantly share code, notes, and snippets.

@natanlao
natanlao / syncthing-photo-sync.md
Last active August 14, 2026 00:07
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality

@LordMZTE
LordMZTE / ANSI.md
Last active January 6, 2022 07:03 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@hisplan
hisplan / ensembl-gtf-file-diffs.md
Last active April 12, 2023 16:34
Ensembl GTF file differences
@backerman
backerman / profile-snippet-sshargcomplete.ps1
Last active August 4, 2026 07:54
Enable tab completion for ssh hostnames in PowerShell
using namespace System.Management.Automation
Register-ArgumentCompleter -CommandName ssh,scp,sftp -Native -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
$knownHosts = Get-Content ${Env:HOMEPATH}\.ssh\known_hosts `
| ForEach-Object { ([string]$_).Split(' ')[0] } `
| ForEach-Object { $_.Split(',') } `
| Sort-Object -Unique
# For now just assume it's a hostname.
@btskinner
btskinner / Makevars
Last active August 14, 2019 14:54
[OUTDATED] Build R with OpenBLAS and OpenMP support on MacOS 10.14 (Mojave)
# --------
# Makevars
# --------
# Homebrew bin / opt / lib locations
HB=/usr/local/bin
HO=/usr/local/opt
HL=/usr/local/lib
# ccache
@ihipop
ihipop / frp systemd.md
Last active November 5, 2024 02:15
FRP systemd 启动脚本 FRP systemd init config
@kagaya
kagaya / across_facet_plot.R
Last active July 13, 2024 12:59
plot a segment connecting points across facets in ggplot
library(tidyverse)
library(grid)
library(gtable)
plot_segment_across_facets <- function(p, from=1, to=2,
from_point_id=1,
to_point_id=1,
plotout = F,
gp=gpar(lty=1, alpha=0.5)){
@hadley
hadley / handlers.md
Created May 31, 2018 14:59
Walk through of R's condition handler C code

Registering handlers

The key C function that powers both tryCatch() and withCallingHandlers() is do_addCondHands(). It creates handler object with mkHandlerEntry() then stores in the handler stack for the current frame. (More precisely it writes to R_HandlerStack, a global variable that is an alias to c->handlerstack)

The five R arguments to do_addCondHands() are classes, handlers, parentenv, target, and calling. These are combined with a result object (a list of length 4, returned by the exiting handler to doTryCatch()) to create the handler objects which have five components:

  • The class, accessed with ENTRY_CLASS(e). A string given a class name; the handler will match all conditions that contain this component in their class vector.
@dentechy
dentechy / WSL-ssh-server.md
Last active July 7, 2026 02:31
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on:
@chrisamiller
chrisamiller / run.R
Last active October 7, 2024 01:42
Fishplot - Updated Clonevol Integration in Additional File 2
library(sciClone)
library(clonevol)
library(fishplot)
## read in the data - copy number
cn1 = read.table("tumor.cn",sep="\t",stringsAsFactors=F)
cn2 = read.table("relapse.cn",sep="\t",stringsAsFactors=F)
cn1 = cn1[,c(1,2,3,5)]
cn2 = cn2[,c(1,2,3,5)]
## read in vaf data