Skip to content

Instantly share code, notes, and snippets.

Kohei Hasegawa banyan

Block or report user

Report or block banyan

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
banyan /
Last active Aug 29, 2015
Most of quotation comes from this post:

React Overview

Why did we build React?

  • React isn't an MVC framework.
  • React doesn't use templates.

It's used by

  • Facebook
> node-sass@1.1.0 install /jenkins/workspace/Tutor Client (deploy to edge)/node_modules/sass-brunch/node_modules/node-sass
> node build.js

`linux-x64-v8-3.14` exists; testing
make: Entering directory `/jenkins/workspace/Tutor Client (deploy to edge)/node_modules/sass-brunch/node_modules/node-sass/build'
  CXX(target) Release/
cc1plus: error: unrecognized command line option ‘-std=c++11’
cc1plus: error: unrecognized command line option ‘-std=c++11’
make: *** [Release/] Error 1
View iframe.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<script type="text/javascript">
window.addEventListener("load", postSize, false);
function postSize(e){
var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
if (typeof target != "undefined" && document.body.scrollHeight)
target.postMessage(document.getElementById("foo").scrollHeight, "*");
View suffix_array.rb
# coding: utf-8
def get_suffix_array(str)
hash = {}
str.size.times do | i |
hash[i + 1] = str.slice(i, str.size)
a = []
hash.each do | x, y |
a << y
View bin_search.rb
# coding: utf-8
def bin_search(array, search)
lowerbound = 0
upperbound = array.size - 1
while (lowerbound <= upperbound)
middle = (lowerbound + upperbound) / 2
return middle if (search == array[middle])
if (search < array[middle])
upperbound = middle - 1
View ameblog.rb
# encoding: utf-8
class Cards
def deal(num_players, deck)
if num_players > deck.scan(/./).size
ary = []
num_players.times do
ary << ""
return ary
View ameblo2.rb
# encoding: utf-8
class ReportAccess
def who_can_see(user_names, allowed_data, report_data)
h = {}
allowed_data.each_with_index do | data, i |
data.split(/ /).each do | v |
h[i] = user_names[i] unless report_data.index(v).nil?
View tumblr.dashboard.expand.embed.user.js
// ==UserScript==
// @name Tumblr Dashboard Expand Embed
// @namespace
// @description From the beginning to show Embed
// @include*
// ==/UserScript==
var expandEmbed = function(node) {
View file_cp.rb
require "fileutils"
files = %w(
src_root = '/path/to/src/'
dest_root = '/path/to/dest/'
View method_missing.rb
class MM2
def setup
puts "Setup"
def teardown
puts "Tear down"
You can’t perform that action at this time.