Skip to content

Instantly share code, notes, and snippets.

View dino-su's full-sized avatar

Dino Su dino-su

View GitHub Profile
" enable syntax highlighting
if has("syntax")
syntax on
endif
" remember the last edited position
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
autocmd BufRead,BufNewFile *.jade setlocal ft=jade
endif
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
# ssh tunnel
alias gateway='ssh -D4444 [email protected]'
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
@dino-su
dino-su / README.md
Last active November 29, 2016 06:18
Android CLI Tips

listing

$ android list sdk --all --extended

update platform tool

$ android update sdk --all --filter platform-tools --no-ui

update build tool

$ android update sdk --all --filter build-tools-24.0.1 --no-ui

update extra tools

alias screensaver='open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app'
@dino-su
dino-su / README.md
Last active July 14, 2019 13:37
Missing Manuals: Waiting without Espresso idling resources.

Sample: Wait for Service

Wait loginComplete = new Wait() {
  @Override
  public Boolean apply() {
    return Service.isLogin() == true;
   }
};

Wait.until(loginComplete);
@dino-su
dino-su / m3u8_to_mp4.md
Last active January 10, 2018 09:50
How to download m3u8 stream.
m3u8_to_mp4() {
    url=${1}
    filename=${2}

    ffmpeg -i $url -c copy -bsf:a aac_adtstoasc $filename
}

Usage: m3u8_to_mp4 ${url} ${filename}

@dino-su
dino-su / README.md
Last active March 16, 2022 07:37
dump HAR with Selenium and Browsermob-Proxy

Package requirement:

  • browsermob-proxy==0.8.0
  • selenium==3.9.0

Usgae: python dump_har.py 'https://www.google.com' | grep mp3

@dino-su
dino-su / Relaxing-Jenkins-CSP.md
Last active February 23, 2018 03:05
Relaxing Jenkins Content Security Policy.

Jenkins Console

// Allow 'unsafe-inline'
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox; default-src 'none'; img-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';")

// Verify the setting
System.getProperty("hudson.model.DirectoryBrowserSupport.CSP")

Reference