Skip to content

Instantly share code, notes, and snippets.

Takayuki Miwa tkyk

  • Kyoto, Japan
Block or report user

Report or block tkyk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tkyk / dotr.rb
Created Aug 12, 2018
Minimal wrapper for Graphviz dot language
View dotr.rb
# Minimal wrapper for Graphviz dot language
# dotr = Dotr.digraph
# # Any ruby objects can be nodes.
# # Node id is `#hash` and default label is `#to_s`.
# dotr.node(1)
# dotr.node(:foo)
# dotr.node(Set[1, 2], label: 'set(1,2)')
# dotr.node({ x: 1 }, label: 'x1')
View dropbox_paper_character_count.js
const sleep = require('sleep');
const Dropbox = require('dropbox').Dropbox;
Dropbox.prototype.paperDocsSearch = function (arg) {
return this.request('paper/docs/search', arg, 'user', 'api', 'rpc');
View wp_char_count.php
define('START_DATE', '2018-03-26');
$args = array(
'date_query' => array(
'after' => START_DATE,
'inclusive' => true,
tkyk / sf34.rb
Created Mar 13, 2014
View sf34.rb
#!/usr/bin/env ruby
STRENGTHS = (1..34).to_a
TOP = 5
def check(max_tries, &pass_checker)
num_pass = 0
max_tries.times do
class Parent
constructor: (options) ->
{@foo, @bar} = options
class Child extends Parent
constructor: (param, args...) ->
@param = param
super args...
a = new Child "aaa", foo: "F", bar: "B"
tkyk /
Created Sep 26, 2012
Octopress does not unescape the path by default
diff --git a/ b/
index b1b746b..2035cb1 100644
--- a/
+++ b/
@@ -1,5 +1,7 @@
+# coding: utf-8
require 'bundler/setup'
require 'sinatra/base'
+require 'uri'
tkyk /
Created Feb 26, 2012
Convert assertion methods from SimpleTest to PHPUnit
# Usage: file1 file2 ...
perl -i -p \
-e 's/assertEquals?/assertEquals/g;' \
-e 's/assertNotEquals?/assertNotEquals/g;' \
-e 's/assertPattern/assertRegExp/g;' \
-e 's/assertIdentical/assertSame/g;' \
-e 's/assertNotIdentical/assertNotSame/g;' \
-e 's/assertNoPattern/assertNotRegExp/g;' \
-e 's/assertReference/assertSame/g;' \
tkyk /
Created Feb 9, 2012
Create a new CakePHP project with git, and manage the cake core with git submodule.

CakePHP 2.0 + Git starter script

A small shell script to bake a new CakePHP project, initialize it as a git repository, and install the cake core as its submodule.



{EventEmitter} = require 'events'
util = require 'util'
class Example
# We can refer to the class we are now defining,
# because it is implemented as a FunctionDeclaration.
util.inherits Example, EventEmitter
constructor: ->
View gist:1518878
# nvm alias wcoffee v0.6.6
alias wcoffee="nvm run wcoffee $(which coffee) --watch"
function wcoffee_compile_tree() {
if [ $# -ne 2 ]; then
echo "wcoffee_build_tree <src_dir> <dest_dir>"
return 1
wcoffee --bare --output $2 --compile $1
You can’t perform that action at this time.