Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

zlin888 zlin888

🎯
Focusing
View GitHub Profile
View keybindings.json
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "right",
"command": "-extension.vim_right",
"when": "editorTextFocus && vim.active && !inDebugRepl"
},
{
"key": "shift+backspace",
"command": "-extension.vim_shift+backspace",
View distdiff.R
dd1 <- c(21000, 23400, 26800)
dd2 <- c(29002, 10000, 70000)
library(viridis)
library(effsize)
library(sm)
library(magicaxis)
library(beanplot)
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View git_cheatsheet.md
@zlin888
zlin888 / python_progress_prompt.py
Last active Jun 24, 2019
Python Progress Prompt
View python_progress_prompt.py
# Print iterations progress
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█'):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)
suffix - Optional : suffix string (Str)
decimals - Optional : positive number of decimals in percent complete (Int)
@zlin888
zlin888 / scrapy_cheatsheet.md
Last active Jul 11, 2020
scrapy cheatsheet
View scrapy_cheatsheet.md

Scrapy Cheatsheet

For test

scrapy shell https://example.com/

Run

scrapy crawl spider_name

Output

scrapy crawl dapps -o data/07-07-dapps.csv
scrapy crawl dapps -t csv -o - >"data/dapp/$DATE-dapp.csv"

View vim_cheatsheet.md

VIM Frequently-used Commands & Configuration

The ultimate Vim configuration: vimrc

https://github.com/amix/vimrc

highlight search results :set hlsearch
temporarily hide highlight until the next search :noh
traverse word backward b

Typing % while the cursor is on a (,),[,],{, or } goes to its match.
To substitute new for the first old in a line type :s/old/new\

View ubuntu_cheatsheet.md

Ubuntu Cheatsheet

  • check disk space: df -H
  • transfer file from server to local: scp your_username@remotehost.edu:foobar.txt /local/dir
  • local to server: rsync -avz -e 'ssh' foobar.txt your_username@remotehost.edu:somewhere
  • find file and remove: find . -maxdepth 1 -regex './[a-z0-9]*' | xargs rm -rf
    find the folder find . -type f
    -maxdepth 1 means non-recursive
    xargs is the command that "converts" its standard input into arguments of another program, or, as they more accurately put it on the man page\
  • count word, line: wc -l -w [file]
You can’t perform that action at this time.