Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am yuku on github.
  • I am yuku (https://keybase.io/yuku) on keybase.
  • I have a public key ASBR6qoqem1JtOWpwaPkVvDYf0lvqoFXeTB-5nnU-mdIIAo

To claim this, I am signing this object:

// @flow
type Params = {
[string]: string | number | null | Array<string | number | null>
}
function encode(val: string | number) {
return encodeURIComponent(val + '').
replace(/%40/gi, '@').
replace(/%3A/gi, ':').

Keybase proof

I hereby claim:

  • I am yuku-t on github.
  • I am yuku (https://keybase.io/yuku) on keybase.
  • I have a public key whose fingerprint is 3D8F 2068 CA57 BED1 BF70 D47E 7B35 F14A 5953 BD16

To claim this, I am signing this object:

@yuku
yuku / benchmark.rb
Last active October 25, 2015 07:18
execjs - therubyracer v.s. Node.js
require "benchmark/ips"
require "execjs"
require "open-uri"
source = open("http://coffeescript.org/extras/coffee-script.js").read
RUNTIMES = [
ExecJS::Runtimes::RubyRacer,
ExecJS::Runtimes::Node,
]
#!/usr/bin/env ruby
SENTENCES = [
# 1
'Once you see all those animals, you should feel better.',
'I need to fix my car as soon as possible.',
'I hope it snows all day long tomorrow.',
'Can I get you anything?',
'How many apples did you eat today?',
"If it is possible, I'd like to have a Diet Coke.",
@yuku
yuku / file0.rb
Last active December 17, 2015 18:40
Qiitaの画像アップロード機能も簡単に実装できる。そう、S3ならね。 ref: http://qiita.com/yuku_t/items/40b7daf018d3dab48974
S3_BUCKET = 'xxx'
AWS_SECRET_KEY = 'xxx'
AWS_ACCESS_KEY_ID = 'xxx'
# アクセスしてきたクライアントにS3へアップロードするためのpolicyと
# それをハッシュ化したsignatureを返す。
def policies
# 0. セッションの確認など
# 1. 画像情報をバリデーションする
// bootstrap-pagination.js
// (c) 2012 Yuku Takahashi
// Freely distributed under the MIT license.
;(function($) {
'use strict'; // jshint
@yuku
yuku / ecma5.js
Created November 14, 2011 18:13
ECMAScript 5
// 8.6.2 Object Internal Properties and Methods
// Evenry ECMAScript object has a Boolean-valued [[Extensible]] internal
// property that controls whether or not named properties may be added to the
// object. If the value of the [[Extensible]] internal property is false then
// additional named properties may not be added to the object. In addition, if
// [[Extensible]] is false the value of the [[Class]] and [[Prototype]]
// internal properties of the object may not be modified. Once the value of an
// [[Extensible]] internal property has been set to false it may not be
// subsequently changed to true.
@yuku
yuku / jawikicorpus.py
Created June 22, 2011 15:40
gensimに日本語Wikipediaを取り込むためのスクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
import os.path
import bz2
from gensim.corpora import WikiCorpus
from gensim.corpora.wikicorpus import filterWiki