Skip to content

Instantly share code, notes, and snippets.

View nobuh's full-sized avatar

Nobuhiro Hatano nobuh

View GitHub Profile
@jboner
jboner / latency.txt
Last active November 15, 2024 14:00
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@johansten
johansten / GLSL randomize
Created September 5, 2012 09:17
The canonical "fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453)" didn't work on Mali-400, so replaced sin() w/ approximation
float a = fract(dot(v_texCoord.xy, vec2(2.067390879775102, 12.451168662908249))) - 0.5;
float s = a * (6.182785114200511 + a*a * (-38.026512460676566 + a*a * 53.392573080032137));
float t = fract(s * 43758.5453);
@ashikawa
ashikawa / memcache.md
Created January 7, 2013 09:27
コンソールで memcache と戦う方法
@ck-on
ck-on / ocp.php
Last active September 5, 2024 01:35
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@mgechev
mgechev / basic-tcp-server.dart
Created June 17, 2013 15:55
Basic TCP server in Dart
import 'dart:core';
import 'dart:async';
import 'dart:io';
void startServer() {
Future<ServerSocket> serverFuture = ServerSocket.bind('0.0.0.0', 55555);
serverFuture.then((ServerSocket server) {
server.listen((Socket socket) {
socket.listen((List<int> data) {
String result = new String.fromCharCodes(data);
@nobuh
nobuh / iptables
Last active August 29, 2015 14:02
/etc/sysconfig/iptables basic template
*filter
# deny all inbound
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
# accept all outbound
:OUTPUT ACCEPT [0:0]
# accept already connected sessions
@nobuh
nobuh / nginx.conf
Created August 26, 2014 02:17
Zone Apex / Naked Domain / Root Domain redirect to the www subdomain by nginx
# Zone Apex / Naked Domain / Root Domain redirect to the www subdomain by nginx
# Here is a part of nginx config file
#
# For example on Debian 6 (Squeeze)
# /etc/nginx/site-available/default
#
server {
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
@shyouhei
shyouhei / gist:0b7dab3e75bfbf96f895
Created March 31, 2015 15:26
新社会人の人が留意すべき事項

新社会人に必須である:

  • 勤務先との書面による「労働契約」。業務委託契約等NG。
  • 多寡を問わず毎月払われる給料。遅配等論外である。
  • 健康保険。
  • 労災保険。
  • 雇用保険。
  • 三六協定。
  • 年次有休。
  • 育児休業の制度があり取得者がいる会社に勤務する。
@ravishchawla
ravishchawla / SimpleDB Setup Instructions.md
Last active October 16, 2024 00:51
Setup instructions for installing and configuring the SimpleDB Server and Client Database
@nobuh
nobuh / how_to_find_good_engineer.md
Last active March 6, 2024 10:23
よいエンジニアの見分け方

よいエンジニアの見分け方

よいエンジニアかどうか見分ける、たった一つの方法で必要にして十分なもの。それは

謙虚さ

何も謙虚な態度をつねにしてなきゃいけない、という訳じゃない。若者特有の「俺最高!」な全能感に突き動かされることもあるだろうし、そうした強さも競争を勝ち抜くために必要なのも事実。

でも、職人的な仕事、とくにエンジニアに関してはこの「謙虚さ」が今までも、そしてこれからももっとも大切な資質になる。これからそれを詳しく解説しよう。