Skip to content

Instantly share code, notes, and snippets.

View pistatium's full-sized avatar
🚲
Cycling

kimihiro_n pistatium

🚲
Cycling
View GitHub Profile
@kkosuge
kkosuge / userstream.twitter.com2user.json.md
Created October 8, 2011 13:52
Twitter の User Streams で流れてくるやつ
@abahgat
abahgat / gae-memcache-decorator.py
Last active January 22, 2021 00:43
A Python decorator to cache method results using memcache on Google AppEngine
import functools
import logging
from google.appengine.api import memcache
def cached(time=1200):
"""
Decorator that caches the result of a method for the specified time in seconds.
Use it as:
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@taichi
taichi / log.md
Last active December 15, 2021 02:12
ログ、その時の為に。
@STAR-ZERO
STAR-ZERO / SampleFragment.java
Created December 13, 2012 03:44
【Android】Fragmentのテンプレート的なもの
public class SampleFragment extends Fragment {
/** Fragmentで保持しておくデータ */
private int mData;
/**
* Fragmentインスタンスを生成した返却.
*
* コンストラクタに引数を渡すのはダメ。
* Fragmentがメモリ不足で破棄され、そこから復帰する時に空のコンストラクタ呼ばれる。
@voluntas
voluntas / shiguredo_tech.rst
Last active April 11, 2024 08:30
時雨堂を支える技術

時雨堂を支える技術

日時

2024-04-11

時雨堂

バージョン

2024.4

URL

https://shiguredo.jp/

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

@kawanet
kawanet / NSURL+dictionaryFromQueryString.h
Last active December 23, 2015 15:49 — forked from halsk/NSURL+dictionaryFromQueryString.h
val にも = が入っていたり、key/val に + があった場合に対応してみました。 val が不正で stringByReplacingPercentEscapesUsingEncoding が例外を出す場合もあるけど未対応。
#import <Foundation/Foundation.h>
@interface NSURL (dictionaryFromQueryString)
-(NSDictionary *) dictionaryFromQueryString;
@end
@voluntas
voluntas / django_new_relic.rst
Last active July 10, 2019 08:05
Django + New Relic コトハジメ

Django + New Relic コトハジメ

更新

2013-11-02

バージョン

0.0.3

作者

@voluntas

URL

http://voluntas.github.io/

概要

@denji
denji / nginx-tuning.md
Last active May 25, 2024 13:32
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@miyamoto-daisuke
miyamoto-daisuke / vpc-knowhow-2014-04.template
Last active October 20, 2020 07:02
VPC knownhow 2014-04
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",