Skip to content

Instantly share code, notes, and snippets.

View Sailfishc's full-sized avatar
🎯
Focusing

张成 Sailfishc

🎯
Focusing
View GitHub Profile

👋 Hi! I'm a Coder @Alibaba working on and trying my best to add some fun to places where your face might show up.

Other stuff: Talk to me about your favorite video games, ceramics, embroidery, and general creative stuff!

° .::' *
* ::: DREAM ° -
° `:: ° *
- `':.. *
@Sailfishc
Sailfishc / youtube-dl.md
Created April 5, 2020 02:49
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

@Sailfishc
Sailfishc / machine.js
Created April 4, 2020 10:24
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Sailfishc
Sailfishc / leetcode_retag.md
Created December 13, 2019 08:27 — forked from Windsooon/leetcode_retag.md
Retag most popular Leetcode problems
@Sailfishc
Sailfishc / present.zsh-theme
Created December 8, 2019 13:59 — forked from BretFisher/present.zsh-theme
oh-my-zsh theme for presentations (hides prompt features based on path)
# problem: when presenting, I want to obscure
# my prompt to act like it's at root of file system
# and be very basic with no git info, etc.
# solution: this theme lets you set a ENV to the path
# of your presentation, which will help remove unneeded prompt
# features while in that path
# oh-my-zsh theme for presenting demos
# based off the default rubbyrussell theme
for nums[finder] == nums[last] {
finder++
if finder == len(nums) {
return last + 1
}
}
@Sailfishc
Sailfishc / latency.txt
Created September 23, 2019 04:56 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
http://www.mca.gov.cn/article/sj/xzqh/2019/201901-06/201902061009.html
@Sailfishc
Sailfishc / install-vagrant-vbguest.sh
Created March 25, 2019 07:18 — forked from lotreal/install-vagrant-vbguest.sh
解决中国局域网中 vagrant plugin install vagrant-vbguest 出错的问题
#!/usr/bin/env bash
GEMS=$(cat <<EOF
childprocess-0.5.8.gem
ffi-1.9.10.gem
little-plugger-1.1.4.gem
micromachine-1.1.0.gem
multi_json-1.11.1.gem
net-ssh-2.9.2.gem
rest-client-1.6.9.gem