Skip to content

Instantly share code, notes, and snippets.

View kohashi's full-sized avatar

kohashi85 kohashi

  • VOYAGE GROUP, Inc.
  • Tokyo, Japan
View GitHub Profile
using UnityEngine;
using UnityEditor;
using System.Collections;
public class ComponentLister : EditorWindow
{
private Hashtable sets = new Hashtable();
private Vector2 scrollPosition;
@kohashi
kohashi / CCLabelTTFWithStroke.h
Created November 1, 2012 03:31
CCLabelTTFWithStroke : Label with Stroke(Shadow) for Cocos2d
//
// CCLabelTTFWithStroke.h
//
// Created by Kohashi on 2012/10/31.
// Copyright 2012年 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
@kohashi
kohashi / enchant.prototype.js
Created June 6, 2012 14:02
enchant.jsをメソッドチェインで使うためのprototype拡張
/**
* enchant.js prototype extension
*
* Copyright (c) 2012 @hako584
* Dual licensed under the MIT or GPL Version 3 licenses
*/
/**
@kohashi
kohashi / gist:2770553
Created May 22, 2012 17:48
Rubyっぽいバッチスクリプトでgyazoに投稿
rem gyazowinR.bat
rem Gyazo client for Windows (Ruby script version)
rem by snaka (http://d.hatena.ne.jp/snaka72/)
ruby -x "%~f0" "%~s1"
pause
exit
#! ruby
require 'net/http'
@kohashi
kohashi / on_tortoiseGit_pull_request.ja.markdown
Created March 28, 2012 16:47
tortoiseGitから、gitHub上のpull requestを解決する

tortoiseGitから、gitHub上のpull requestを解決する

pull requestでは、ファイルの更新がかち合っただけでgitHubのWebページ上では編集できなくなる。

gitHubのヒントに、コマンドベースで解決する方法は載っているが、win上でtortoiseGitを使っている場合に面倒なので解決策を記してみる。


gitHubで出てくるコマンドはこんな感じ :

@kohashi
kohashi / scaling_isomorphic_javascript_code.ja.markdown
Created March 28, 2012 15:49 — forked from tily/scaling_isomorphic_javascript_code.ja.markdown
サバクラ両方で動く JavaScript の大規模開発を行うために

サバクラ両方で動く JavaScript の大規模開発を行うために

原文:Scaling Isomorphic Javascript Code (This is just for study, please contact me at tily05 atmark gmail.com if any problem.)

考えてみれば Model-View-Controller とか MVC ってよく聞くよね。実際どんなものか知ってる? 抽象的に言うなら「オブジェクト情報の保持されるグラフィック・システム (つまり、ラスターではないグラフィック。ゲームとか) 上に構築された、表示系を中心としたアプリケーションにおいて、主要な機能どうしの関わりをうまく分離すること」とでも言おうか。もう少し深く考えを押し進めてみれば、これは当然、他のさまざまなアプリケーションにもあてはまる言葉 (bucket term ?) だ。

過去に多くの開発コミュニティが MVC による解決案を提供し、それによってよくあるユースケースにうまく対処し、地位を築くことができた。例をあげるなら、Ruby や Python コミュニティは Rails や Django を作り、MVC アーキテクチャを実現した。

@kohashi
kohashi / gist:1992326
Created March 7, 2012 09:59
bookmarklet for favstar.fm entry to CSV.
javascript:(function(){var r='';var FN=function(f,n){var t=f(n);return t.length?t[0].getElementsByClassName('count')[0].innerHTML:0};var DD=function(f){var d=new Date(f('js_time_repl')[0].attributes['data-time'].value);return d.getFullYear()+'/'+(d.getMonth()+1)+'/'+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();};var a=document.getElementsByClassName('tweetWithStats');for(var i=0;i%3ca.length;i++){var f=function(n){return a[i].getElementsByClassName(n)}; r+=FN(f,'favCount')+','+FN(f,'rtCount')+',"'+DD(f)+'","'+(f('theTweet')[0].innerText||f('theTweet')[0].textContent)+'"\r\n';};e=document.createElement('textarea');e.innerHTML=r;e.style.width='100%';e.style.height='300px';document.getElementById('streamTitle').appendChild(e);})();
@kohashi
kohashi / preload_images.php
Created March 7, 2012 09:52
preload_images
<?php
/**
* Returns a html to preload images using jQuery.
*
* @param array $urls An array of image URLs
* @return string HTML contents
*/
function preload_images($urls)
{
if (!is_array($urls)) {