Skip to content

Instantly share code, notes, and snippets.

Method #1: Using bash without getopt[s]
Two common ways to pass key-value-pair arguments are:
Bash Space-Separated (e.g., --option argument) (without getopt[s])
Usage demo-space-separated.sh -e conf -s /etc -l /usr/lib /etc/hosts
cat >/tmp/demo-space-separated.sh <<'EOF'
#!/bin/bash
POSITIONAL=()
@walkoncross
walkoncross / json_encoding.txt
Last active April 7, 2020 07:53
how does json encode number type?
http://www.ecma-international.org/ecma-262/5.1/#sec-9.8.1
9.8.1ToString Applied to the Number Type
The abstract operation ToString converts a Number m to String format as follows:
If m is NaN, return the String "NaN".
If m is +0 or −0, return the String "0".
If m is less than zero, return the String concatenation of the String "-" and ToString(−m).
If m is infinity, return the String "Infinity".
Otherwise, let n, k, and s be integers such that k ≥ 1, 10k−1 ≤ s < 10k, the Number value for s × 10n−k is m, and k is as small as possible. Note that k is the number of digits in the decimal representation of s, that s is not divisible by 10, and that the least significant digit of s is not necessarily uniquely determined by these criteria.
@walkoncross
walkoncross / install_vim_plug.sh
Last active April 6, 2020 10:26
vimrc plugins
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
@walkoncross
walkoncross / WebGL-frameworks-libraries.md
Created April 1, 2020 21:36 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL frameworks and libraries

A non-exhaustive list of WebGL frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • Filament: Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS and WASM/WebGL
  • ClayGL: A WebGL graphic library helping you to
@walkoncross
walkoncross / ffmpeg.md
Created December 12, 2019 10:16 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@walkoncross
walkoncross / ffmpeg.md
Created December 12, 2019 10:16 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@walkoncross
walkoncross / Ubuntu_sources.list
Created June 20, 2019 13:12
Ubuntu sources.list for China
# 如果有需要,根据系统版本将 vivid 替换为 utopic, trusty, precise 等即可
# 163, sohu, aliyun 三者开启其一即可,个人测试觉得 163 最快
# aliyun
deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
@walkoncross
walkoncross / git checkout-all-branches.sh
Created March 17, 2019 03:57
git checkout-all-branches
#!/bin/bash
#Whenever you clone a repo, you do not clone all of its branches by default.
#If you wish to do so, use the following script:
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git branch --track ${branch#remotes/origin/} $branch
done
name: "ONet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 48
input_dim: 48
##################################
layer {
name: "conv1"
type: "Convolution"
name: "Facex-Lanamark-Net-7Conv-Slim-s2"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 48
input_dim: 48
##################################
layer {
name: "conv0"
type: "Convolution"