Skip to content

Instantly share code, notes, and snippets.

View chanlito's full-sized avatar

Chanlito chanlito

  • undefined
  • 18:28 (UTC +07:00)
View GitHub Profile
@chanlito
chanlito / 5-elixir-patterns-i-wish-every-language-had.md
Created March 15, 2026 17:11
5 Elixir patterns I wish every language had

5 Elixir Patterns I Wish Every Language Had

Some languages make you feel clever. Elixir makes you feel like the codebase might survive you.

1. Pattern matching as a normal control-flow tool

case result do
  {:ok, user} -> {:ok, user.email}
@chanlito
chanlito / 5-javascript-patterns-i'd-miss-in-other-languages.md
Created March 15, 2026 17:11
5 JavaScript patterns I'd miss in other languages

5 JavaScript Patterns I'd Miss In Other Languages

JavaScript is messy. Still, it has a few patterns that feel so sharp and expressive that losing them would hurt.

1. Closures as private state without ceremony

function createCounter() {
  let count = 0
@chanlito
chanlito / gist:8665e623d0826520a94c416cfce44d81
Created August 5, 2018 10:35 — forked from SimonSun1988/gist:2ef7db45e46b889783647d941ec15e4d
解決 Ubuntu "can’t set the locale; make sure $LC_* and $LANG are correct" 的錯誤
## 安裝語系檔
`$ sudo locale-gen "en_US.UTF-8"`
## 重新設定語系檔
`$ sudo dpkg-reconfigure locales`
## 設定檔
@chanlito
chanlito / .editorconfig
Created May 21, 2018 14:42
Editor Config
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@chanlito
chanlito / tslint.json
Created May 21, 2018 14:41
TSLint Configuration
{
"defaultSeverity": "warning",
"extends": [
"tslint-config-airbnb",
"tslint-config-prettier"
]
}
@chanlito
chanlito / .prettierignore
Created May 21, 2018 14:40
Prettier Ignored Files
# dependencies
package.json
# linters config
.eslintrc
tslint.json
# typescript config
client/tsconfig.json
server/tsconfig.json
@chanlito
chanlito / .prettierrc
Last active May 21, 2018 14:40
Prettier
{
"bracketSpacing": true,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}