Skip to content

Instantly share code, notes, and snippets.

View kobake's full-sized avatar

KOBAYASHI Keiichi kobake

View GitHub Profile
@kobake
kobake / console-log-wave
Last active August 29, 2015 14:19
console log wave
function hex2(n){
var ret = Number(n).toString(16);
if(ret.length < 2)ret = '0' + ret;
return ret;
}
function rgb(r,g,b){
return '#' + hex2(r % 256) + hex2(g % 256) + hex2(b % 256);
}
var Ball = function(index){
this.x = 0;
@kobake
kobake / gist:0840d79e2c2c0067c8f5
Last active August 29, 2015 14:01
関数コールの監視その2
// コールを監視するかどうか
function IsWatchFunction(name){
if(name == 'setTimeout') return false;
if(name == 'clearTimeout') return false;
if(name == 'DOMEvent') return false;
if(name == 'typeOf') return false;
if(name == 'instanceOf') return false;
if(name == 'getCallStack') return false;
if(name == 'logging') return false;
if(name == 'watchFunctions') return false;
@kobake
kobake / gist:5b3f9253d06e9b0ae717
Created May 29, 2014 10:23
関数コールの監視その1
// window配下の関数すべてにログ関数を仕込む
// ※仕込む必要ないやつは名前判定でスキップする
function watchFunctions(loggingFn) {
var name, fn;
for (name in window) {
fn = window[name];
if (typeof fn === 'function') {
// ログ出力したくない関数をここでスキップ
if(name == 'setTimeout') continue;
if(name == 'clearTimeout') continue;
@kobake
kobake / gist:11312027
Last active August 29, 2015 14:00
Chrome ソース取得するために gclient sync してたけど、途中でネットワーク切断しちゃったときのログ(なんとなく残しておいてみる)
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\tests\sunspider-controlflow-recursive.html
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\tests\sunspider-date-format-xparb.html
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\dino1.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\clouds2.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\dino2.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\dino3.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\right.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\dino4.png
A src\third_party\WebKit\PerformanceTests\Dromaeo\resources\dromaeo\web\images\dino5.png
@kobake
kobake / gist:10108246
Created April 8, 2014 10:36
"npm install webpay" error
[kobake@centcarbon sodoneWeb]$ npm install webpay
npm WARN package.json express-session@1.0.2 No repository field.
npm http GET https://registry.npmjs.org/webpay
npm http 304 https://registry.npmjs.org/webpay
npm http GET https://registry.npmjs.org/webpay/-/webpay-1.0.0.tgz
npm http 404 https://registry.npmjs.org/webpay/-/webpay-1.0.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/webpay/-/webpay-1.0.0.tgz
npm ERR! Error: 404 Not Found
npm ERR! at WriteStream.<anonymous> (/usr/lib/node_modules/npm/lib/utils/fetch.js:57:12)
npm ERR! at WriteStream.EventEmitter.emit (events.js:117:20)
@kobake
kobake / game
Last active January 1, 2016 01:49
game
// 描画先
class Dst{
int x;
int y;
};
// セル位置
class CellPos{
int x;
int y;
@kobake
kobake / ack.cpp
Created December 9, 2013 10:35
Ackermann Function
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <stdarg.h>
#include <vector>
bool g_verbose = false;
// 再帰呼び出し使わない版
int Ack(int m_input, int n_input)
@kobake
kobake / gist:6345208
Last active December 21, 2015 18:09
trueになる。
<?php
$a = "10a";
$b = 10;
if($a == $b){
print "true";
}
else{
print "false";
}
@kobake
kobake / gist:6344947
Last active December 21, 2015 18:08
trueになる。
hoge = 0
if hoge then
print "true"
else
print "false"
end
@kobake
kobake / ssd_bench
Created July 19, 2013 18:44
SSDベンチマーク結果
-----------------------------------------------------------------------
CrystalDiskMark 3.0.2 x64 (C) 2007-2013 hiyohiyo
Crystal Dew World : http://crystalmark.info/
-----------------------------------------------------------------------
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]
Sequential Read : 434.949 MB/s
Sequential Write : 141.902 MB/s
Random Read 512KB : 355.272 MB/s
Random Write 512KB : 152.722 MB/s