Skip to content

Instantly share code, notes, and snippets.

View kobake's full-sized avatar

KOBAYASHI Keiichi kobake

View GitHub Profile
@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 / 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: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: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 / 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 / console-log-wave
Created April 25, 2015 07:40
console-log-wave
test
@kobake
kobake / github-markdown-toc-bookmarklet
Last active August 29, 2015 14:23
GitHub の Markdown に TOC (目次) を付けるブックマークレット ref: http://qiita.com/kobake@github/items/3f29a0e20ae4c49e0c81
javascript:(function(){/* style */var style = (function () {/*.toc{border: 1px solid #aaa;padding: 4px 12px;margin-bottom: 12px;position: relative;padding-top: 30px;}.toc-title{display: inline-block;width: auto;background-color: #ccc;position: absolute;left: 0px;top: 0px;font-size: 8pt;padding: 2px 4px;padding-right: 8px;color: #666;}.toc-h{font-size: 11pt;}.toc-h1{}.toc-h2{margin-left: 20px;}.toc-h3{margin-left: 40px;}*/}).toString().match(/[^]*\/\*([^]*)\*\/\}$/)[1];$('.toc-style').remove();$('body').append($('<style class="toc-style">\n' + style + '\n</style>'));/* toc frame */$('.toc').remove();var $toc = $('<div class="toc"><div class="toc-title">TOC</div></div>');$toc.prependTo($('.markdown-body'));/* each links */$('.markdown-body h1, .markdown-body h2, .markdown-body h3').each(function(){/* level */var tagName = $(this).prop('tagName').toLowerCase();/* link div */var $div = $('<div class="toc-h toc-' + tagName + '"></div>');/* link */var $a = $('<a href=""></a>');$a.appendTo($div);$a.text($(this).text
@kobake
kobake / agg.php
Last active December 17, 2015 03:09
凝集型クラスタリング
<?php
/*
実行例
php agg.php 0,1,3,5.5,10,7,8.8
*/
// 区切り文字
$IN_DELIM = ','; // クラスタ内区切り文字
$OUT_DELIM = ' | '; // クラスタ間区切り文字
@kobake
kobake / sample.csproj&nbsp;(after)
Created June 12, 2013 08:54
Partialクラスのファイルを元クラスの子として表示 ref: http://qiita.com/items/87239e4d50fe0031513c
<Compile Include="Forms\Form1.Hoge.cs">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Code</SubType>
</Compile>
@kobake
kobake / hello world 2
Created June 12, 2013 09:50
hello world
test