This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# push to new github repo | |
git remote add origin [email protected]:jxu/repo.git # use set-url if already set | |
git push -u origin master | |
# check out a remote branch | |
git fetch | |
git branch -v -a # list all branches | |
git switch branchname | |
# change remote a branch is tracking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Custom vim config with my comments | |
" (mostly from the ultimate Vim config amix/vimrc) | |
" => General | |
set nocompatible " Disable compatibility mode | |
set history=1000 " Save more commands | |
set autoread " Read file when changed externally | |
set autowrite " Autosave before commands like :make | |
set noswapfile " No more .swp! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
H | |
He | |
Li | |
Be | |
B | |
C | |
N | |
O | |
F | |
Ne |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
# Trying to automate android backups but fed up with bash :( | |
# TODO: Nicer mode selection? | |
import os | |
import subprocess | |
import sys | |
SD_DIR = "sdcard1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# -n for dry run, --del to delete at dest | |
# --info and --no-i-r just for showing progress | |
rsync -avh --del /home/jx --info=progress2 --no-i-r --stats \ | |
--exclude .local/share/Trash --exclude .cache \ | |
'/media/jx/Toshiba 2TB/ubuntu_backup_latest' 2> rsync.err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias yt-audio='yt-dlp -x --audio-format mp3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rsync -av --progress --inplace --omit-dir-times --no-perms --delete-after --exclude='.git/' music-player/ '/run/user/1000/gvfs/mtp:host=Google_Pixel_4a_0A101JEC213910/Internal shared storage/Music/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
import json | |
import os | |
DATA_DIR = "data" | |
def main(): | |
conn = sqlite3.connect("danbooru2018.db") | |
c = conn.cursor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(gridExtra) | |
set.seed(10716) | |
gaussian_matrix <- function(nrow, ncol, mean, sd) { | |
matrix(rnorm(nrow*ncol, mean, sd), nrow, ncol) | |
} | |
uniform_matrix <- function(nrow, ncol, min, max) { |