Skip to content

Instantly share code, notes, and snippets.

View kuronekomichael's full-sized avatar
🤡
“You cheated not only the game, but yourself"

Koki Nakashima kuronekomichael

🤡
“You cheated not only the game, but yourself"
View GitHub Profile
@kuronekomichael
kuronekomichael / gist:1624253
Created January 17, 2012 02:52
Standard Initializer
- (id) init
{
self = [super init];
if (self != nil) {
// init code
}
return self;
}
<!-- sample -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript" src="http://assets3.github.com/javascripts/bundle_gist.js"></script>
<link type="text/css" rel="stylesheet" href="https://github.com/stylesheets/bundle_common.css" />
<link type="text/css" rel="stylesheet" href="https://github.com/stylesheets/bundle_gist.css" />
@kuronekomichael
kuronekomichael / scaling_isomorphic_javascript_code.ja.markdown
Created August 30, 2012 05:01 — 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 アーキテクチャを実現した。

@kuronekomichael
kuronekomichael / Preferences.sublime-settings
Last active December 22, 2015 04:48
tern_for_sublimeのauto_complete_triggers設定例
{
〜(略)〜
"auto_complete_triggers": [
{"selector": "text.html", "characters": "<"},
{"selector": "source.js", "characters": "."}
]
〜(略)〜
}
@kuronekomichael
kuronekomichael / Preferences.sublime-settings
Last active December 22, 2015 04:48
tern_for_sublimeのtern_argument_hints設定例
{
〜(略)〜
"tern_argument_hints": true
〜(略)〜
}
@kuronekomichael
kuronekomichael / Sample.sublime-project
Last active December 22, 2015 04:48
Sublime Text2 のプロジェクト設定ファイルのひな形です。 「除外ファイルってどうやるんだっけ?」とか「個別の設定ってトップレベルで良かったっけ?」とかすぐに忘れちゃうので(;^ω^)
{
"folders":
[
{
// プロジェクトに含めるディレクトリ
"path": ".",
// 除外するディレクトリパターン
"folder_exclude_patterns": [],
// 除外するファイルパターン
"file_exclude_patterns": ["*.sublime-workspace"]
@kuronekomichael
kuronekomichael / setup_tern_for_sublime.sh
Created September 3, 2013 04:11
Package Controlでtern_for_sublimeを入れた後の、仕上げの設定
cd "${HOME}/Library/Application Support/Sublime Text 2/Packages/tern_for_sublime"
npm install
@kuronekomichael
kuronekomichael / index.js
Created September 6, 2013 15:06
expressで静的なJSONを返すだけのサーバを極力小さいコードで書いた感じ $ npm init $ npm install express --save-dev $ npm start
var express = require('express'),
port = 48172,
ret = { name:'hello', value:'world' };
express().get('/', function(req, res) {
res.contentType('application/json').send(JSON.stringify(ret));
}).listen(port, function() {
console.log("express server on localhost:%d", this.address().port);
});
@kuronekomichael
kuronekomichael / .gitignore
Created September 23, 2013 15:19
とりあえずの .gitignore みたいな
## Node ##
#------------
npm-debug.log
node_modules
## OSX ##
#------------
.DS_Store
.AppleDouble
.LSOverride
@kuronekomichael
kuronekomichael / post-checkout
Last active October 27, 2020 08:55
git clone元のサーバによって、user.nameやuser.emailを切り替えるフックスクリプト git clone hook post checkout
#!/bin/sh
# post-checkout
# =============
# arguments
# $1: ref of the previous HEAD e.g.) 0000000000000000000000000000000000000000
# $2: ref of the new HEAD e.g.) 959224d097072c8a5640fee31bac7325710eada1
# $3: flag = ブランチをチェックアウトした場合=1, ファイルをチェックアウトした場合=0
# `git clone`時だけ処理をしたいので、通常の`git checkout`時には何もしない
if [ "$1" != "0000000000000000000000000000000000000000" -o "$3" != "1" ]; then