Skip to content

Instantly share code, notes, and snippets.

View kojilin's full-sized avatar
🐶
This is fine ☕ 🔥

Koji Lin kojilin

🐶
This is fine ☕ 🔥
  • LY Corporation
  • Fukuoka, Japan
  • X @kojilin
View GitHub Profile
@trustin
trustin / setup-docker.sh
Created January 10, 2024 11:37
How to install Docker on macOS without using Docker Desktop
#!/usr/bin/env bash
set -Eeuo pipefail
# Install Docker CLI and Docker Compose, etc.
brew install docker docker-compose docker-credential-helper
# Configure Docker CLI.
mkdir -p "$HOME/.docker/cli-plugins"
ln -sfn '/opt/homebrew/opt/docker-compose/bin/docker-compose' "$HOME/.docker/cli-plugins/docker-compose"
echo '{
@ingramchen
ingramchen / sealed_example.kt
Last active February 23, 2023 03:36
Domain Model Layer Convention (Model 層級管理)

Model 層級管理

Domain Model 層的意義

一個傳統 Java Spring 的應用程式會分為三層 @Controller @Service @Repository,然後依據組織需求,再往下細分。 比方說 Service 層複雜的話,會增加 Gateway、Facade 層,或是我們組織獨有的 CoreService 層

另一個層級大部份 Java 組織會忽略的是 Domain Model 層,絕大多數 Java 開發者會開個 entity 或 model package,然後 將所有的 Entity 往裡面丟。然而該 Entity 只是一堆欄位和 getter/setter 的堆疊,也就是單純的 Table 的對應物件而已, 不具備任何 business logic

@maiha
maiha / RateLimit.md
Last active July 3, 2024 16:15
RateLimitアルゴリズムまとめまとめ (→ Sliding window countersでOK)

TL;DR

  • Leaky bucket : キューイングして出力量(consume)で調節 (アルゴリズムというかキューを使って調節)
  • Token bucket : 定期的に資源を追加し平均値を調節。バーストに強い (ソシャゲのスタミナ回復)
  • Fixed window counters : 単位時間あたりの上限値を指定。キューを使わないLeaky bucket。境界の2倍問題あり
  • Sliding window log : 総数(counters)でなくアクセス時刻(log)で管理。境界問題を解消する一方、消費増加がぱない(IntArray(Time))
  • Sliding window counters : countersのままで、単位時間の割合計算によって境界問題を解消。これにしておけば間違いない

参考: 様々なrate limitアルゴリズム

@ingramchen
ingramchen / 00-ubuntu-intellij-macosx.md
Last active April 19, 2024 15:42
Use ubuntu/Intellij like macOS X

How to mimic full macOS Intellij behavior in Ubuntu

  • Enviroment
    • Ubuntu 20.04
    • Intellij IDEA 2020

Ubuntu gnome shell shortcuts

@mpppk
mpppk / clean_architecture.md
Last active December 5, 2025 07:33
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@rylev
rylev / rust-in-large-organizations-notes.md
Last active June 12, 2025 16:06
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
@mala
mala / nwc.md
Created January 15, 2019 23:41
次世代Webカンファレンス 2019 振り返り

次世代Webカンファレンス 2019 振り返り

  • この文章に関しても所属組織とは関係のない個人の見解です

所感など

  • 本当に全く打ち合わせをしていないので、話題が分散しがちだったかもしれない。
  • せっかくの所属組織とは無関係のレギュレーションなので、具体名を上げてガンガン治安の悪いことを言うつもりだったのだけど、直前に「具体的な企業名は避けましょう」と言われて若干遠慮した。
  • マズいことをガンガンしゃべる覚悟で来たので、防刃ベストを着ているが、特に出番は無かった。トイレにも行った。
  • 本当は話す予定だったトピックについて、いくつかは、別途private gistに書く。
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active November 10, 2025 03:11
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@steven2358
steven2358 / ffmpeg.md
Last active December 11, 2025 18:19
FFmpeg cheat sheet

注意:指令在後續版本略有修改,建議閱讀專案 README。

SNAFU 使用教學(暫定)

這篇文章會簡單描述如何使用 SNAFU Python installer manager

這個專案源自我對社群不懂 Windows 又愛亂教的不滿。如果有興趣讀相關故事,以及一些背後邏輯,可以參考我在碼天狗上的抱怨文

特點