Skip to content

Instantly share code, notes, and snippets.

View shoito's full-sized avatar
🏠
Working from home

shoito shoito

🏠
Working from home
View GitHub Profile
@hail2u
hail2u / csslint-rules.md
Last active April 29, 2023 14:59
CSSLintのRulesの超訳

訳注

これは超訳です。

CSSLintは「なんでこんなルールなんだ…」とイラっとすることが多いですけど、それぞれにそれなりに理由があります。まぁ勿論無視するべきなルールとかもあります。例えば見出し要素の再定義禁止とかはHTML5に対するCSSなら無理な話です。そんなわけでどんな理由なのかを簡単に訳しました。無視するかどうかは自分で決めましょう!

この訳はCSSLintと同じライセンスで提供されます。

Possible Errors

@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 = [email protected]: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:

@mikeda
mikeda / nginx.conf
Last active May 12, 2019 23:21
Nginxでクエリストリングを見て振り分け先を切り替える。 http://localhost/test.txt?para1=AAA ならバランサ1、 http://localhost/test.txt?para1=CCC ならバランサ2
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@fcalderan
fcalderan / perftest.sh
Last active March 8, 2017 14:37
A small bash utility for testing slower connection. Use chmod +x perftest.sh to make the script executable. Thanks to Matteo Rosati for sharing basic commands
#!/bin/sh
CMD="$1"
RATE="$2"
DELAY="$3"
if [ "$RATE" = "" ] ; then
RATE=500
fi
if [ "$DELAY" = "" ] ; then
@voluntas
voluntas / shiguredo_tech.rst
Last active November 10, 2024 05:11
時雨堂を支える技術

時雨堂を支える技術

日時:2024-11-10
作:時雨堂
バージョン:2024.5
URL:https://shiguredo.jp/

時雨堂クラウドサービスを支える技術

@hgfischer
hgfischer / benchmark+go+nginx.md
Last active April 11, 2024 22:09
Benchmarking Nginx with Go

Benchmarking Nginx with Go

There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.

So, these are the different settings we are going to compare:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
@voluntas
voluntas / shiguredo.rst
Last active August 29, 2024 11:42
時雨堂コトハジメ
@mercul3s
mercul3s / gist:56d73cb74ed71bf0813e
Created September 3, 2014 20:34
Example dashing job for elasticsearch cluster health
require 'elasticsearch'
# defaults to "localhost"
client = Elasticsearch::Client.new log: true
SCHEDULER.every '5s', :first_in => 0 do |job|
health = client.cluster.health
send_event('es_health', {value: health['status']})
end
@azu
azu / react-toggle.md
Last active August 22, 2018 02:01
ReactでToggleコンポーネントを作るケース
  1. ABToggleButtonのような実装を各Toggleしたいコンポーネントごとに作る
    • クラスが増える
    • class ABToggleButton extends React.Component{}
    • ToggleButtonごとに明示的な名前をつけられる
    • <ABToggleButton isEditing={true}/>
    • 必要なコンポーネント = 3ファイル
  2. 関数を使う
    • 引数にa, b
    • createToggleButton(a, b);
  • 高階関数を使うパターン