Skip to content

Instantly share code, notes, and snippets.

View bucker's full-sized avatar

susi bucker

  • Google
  • Taiwan
View GitHub Profile
@bucker
bucker / code_review_checklist.txt
Last active December 4, 2020 16:28 — forked from kashifrazzaqui/code_review_checklist.txt
Code Review Checklist
## General
[ ] The code works
[ ] Follows coding conventions
[ ] There are no usages of 'magic numbers'
[ ] All variables are in the smallest scope possible
[ ] All class, variable, and method modifiers are correct.
[ ] There is no dead code (inaccessible at Runtime)
[ ] No code can be replaced with library functions
[ ] Required logs are present
[ ] No debugging code, no System.out.print, no stack traces info
@bucker
bucker / gist:96c8108a9ff1f54cbebd
Last active September 7, 2019 13:00
Android - Product flavors

A product flavor defines a customized version of the application build by the project. A single project can have different flavors which change the generated application

ex: set two different flavors of your app

productFlavors {
    develop {
        applicationId "com.your.app.1"
        versionName "1.0.0"
@bucker
bucker / OkHttp recipe.md
Last active September 7, 2019 13:00
OkHttp recipe for dummy

OkHttp recipe

  • Using POST
OkHttpClient client = new OkHttpClient();
String url = "http://youserver.com";
RequestBody body = new FormEncodingBuilder()
    .add("id", id)
 .add("idx", idx)
@bucker
bucker / bash_shortcut.md
Last active May 16, 2021 17:31
Bash shortcuts for Mac

To Use the option (⌥) key, set it as meta key

Moving the cursor

  • ⌃a: Go to the beginning of the line
  • ⌃e: Go to the end of the line
  • ⌃p: Previous command (Up arrow)
  • ⌃n: Next command (Down arrow)
  • ⌃f: Forward one character
  • ⌃b: Backward one character
  • ⌃xx: Toggle between the start of line and current cursor position

Android Code style guidelines

Java Rules

  1. 正確處理 Exceptions: 不要直接 catch generic Exception

  2. 不要使用Finalizer (try-finally)

  • Effective Java 2nd - Item 7
  • JLS 規格書不保證 finalizer 會被及時執行,也不保證一定會被執行。
  • 在 finalizer 執行跟時間相關的操作,就可能發生錯誤。
@bucker
bucker / gist:c35e80918616ad3d2fc9
Last active September 7, 2019 13:00
.gitconfig alias
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
@bucker
bucker / .gitignore
Last active September 7, 2019 13:01 — forked from keyboardsurfer/.gitignore
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# built application files
*.apk
*.ap_
# lint folder
lint
@bucker
bucker / Git Flow notes.md
Last active September 7, 2019 13:01
Git Flow recipe

Git Flow Notes

Setup

$ brew install git-flow

Initialize git-flow inside an existing git repository