Skip to content

Instantly share code, notes, and snippets.

View kan's full-sized avatar

Kan Fushihara kan

View GitHub Profile
### Keybase proof
I hereby claim:
* I am kan on github.
* I am kanf (https://keybase.io/kanf) on keybase.
* I have a public key ASA-LVPByPaW4fJttKqYQ6EC71ws5sU6ZGasyKGH7gBmpQo
To claim this, I am signing this object:
@kan
kan / search_history.js
Last active October 7, 2016 06:38 — forked from azu/switchViewedSearches.js
検索結果のタブを一覧表示するタブを作るtwicli plugin
/* twicli plugin (http://twicli.neocat.jp/)
* search_history.js
* 検索結果を保持して再利用可能に
* https://goo.gl/qPHfx6
*/
var tws_history = (readCookie('twicli_search_history') || "").split(/\r?\n/);
tws_history.uniq();
registerPlugin({
defmodule Erolang do
def do_run(code, vars) do
case code do
["set", key, val] ->
{v, vars} = do_run(val, vars)
{nil, Map.put(vars, key, v)}
["get", key] ->
{vars[key], vars}
["+", val1, val2] ->
{v1, vars} = do_run(val1, vars)
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
{
package Foo;
use Mouse;
has 'foo' => ( is => 'rw', isa => 'Str', lazy_build => 1 );
@kan
kan / clip.pl
Created April 12, 2013 09:08 — forked from anonymous/clip.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Mac::Pasteboard;
my $pb = Mac::Pasteboard->new();
my $text = '';
# Starlet
Concurrency Level: 8
Time taken for tests: 2.144 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 41378274 bytes
HTML transferred: 40008000 bytes
Requests per second: 4665.05 [#/sec] (mean)
In considering the name of Smart::Options, I referred to the following modules.
https://metacpan.org/module/Smart::Comments
https://metacpan.org/module/Smart::Args
These modules are used widely and I think that using Smart:: as namespace of a CPAN module has taken large agreement.
Moreover, since it thinks that it should not be simply performed since change of a module name is an act which gives a user a burden, there is no intention according to naming change.
@kan
kan / gist:5027250
Last active December 14, 2015 04:19 — forked from kazuho/gist:5027236

#MessagePackの文字列型追加において、Extended型を導入する提案

本提案は https://gist.github.com/frsyuki/5022569 https://gist.github.com/frsyuki/5022460 において提案された「バイナリ型」の構造に変更を施すものである。

##解決しようとする問題

  • MessagePackへの拡張は今後行われないとしても、独自に拡張する提案が今後頻発しそう
  • 拡張フォーマットは、既存のMessagePackに対して後方互換にならない(なりようがない)ため、相互運用性を損なう可能性が高い

##提案する手法

@kan
kan / bench.pl
Created February 23, 2013 07:16 — forked from anonymous/bench.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Benchmark 'cmpthese';
use Data::Riak;
use Data::Riak::Fast;
use Net::Riak;
use Smart::Options;
my $argv = Smart::Options->new()->type(foo => 'Str')->parase('bar');
$argv->{foo} # => 'bar'
my $argv = Smart::Options->new()->type(foo => 'ArrayRef')->parase('bar');
$argv->{foo} # => ['bar']