Skip to content

Instantly share code, notes, and snippets.

@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アルゴリズム

@ksato9700
ksato9700 / emacs.rb
Last active January 13, 2016 06:25
emacs 24.4 homebrew formula with japanese option
require "formula"
class Emacs < Formula
homepage "https://www.gnu.org/software/emacs/"
stable do
url "http://ftpmirror.gnu.org/emacs/emacs-24.4.tar.xz"
mirror "https://ftp.gnu.org/pub/gnu/emacs/emacs-24.4.tar.xz"
sha256 "47e391170db4ca0a3c724530c7050655f6d573a711956b4cd84693c194a9d4fd"
Java のコードを
pythonista に持ち込む:まぁ、Java も書けなくはないけどね
rubyist に持ち込む:ツマラン、どこかに細工してやろうか・・・
perler に持ち込む:出てけゴルァァァァァァァァァァァ!!
Python のコードを
Java エンジニアに持ち込む:おぅ、Python のコードか
rubyist に持ち込む:スクリプト言語の僚友だ、バッチリ直してやるぜ
perler に持ち込む:けっ、優等生か
@aseemk
aseemk / coffeescript-updates.md
Last active December 2, 2017 20:22
CoffeeScript upcoming changes.

CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.

Parentheses-free chaining

jashkenas/coffeescript#3263

Years of being wished for, finally granted!

@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@masuidrive
masuidrive / gist:5169096
Created March 15, 2013 11:11
nodeとmrubyのissuesとcommentsの単語分布
1, this, 17544
2, that, 15950
3, have, 9742
4, with, 9584
5, http, 8688
6, node, 6024
7, should, 5743
8, error, 4285
9, test, 4209
10, work, 4175
@kui
kui / vol.sh
Created February 1, 2013 15:01
change sound volume with notify-osd
#!/bin/sh
# see https://bbs.archlinux.org/viewtopic.php?id=69589
usage="$0 Version $version Help\nDependencies: libnotify, alsa-utils\nusage:\n\t $0 [OPTIONS] -c COMMAND \nCOMMAND:\n-c\t up \n\t\t(increase volume by increment)\n\tdown \n\t\t(decrease volume by increment)\n\tmute \n\t\t(mute volume) \n\nOPTIONS:\n-i\t increment \n\t\t(the amount of db to increase/decrease)[default:2500] \n-m\t mixer \n\t\t(the device to change)[default:Master]"
command=
increment=2500
mixer="Master"
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@juno
juno / github-flow.ja.md
Last active April 9, 2021 02:20
GitHub Flow (Japanese translation) Latest version is here: https://gist.github.com/Gab-km/3705015

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップでgit-flowについてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。