Skip to content

Instantly share code, notes, and snippets.

View is8r's full-sized avatar
🙂

Yu Ishihara is8r

🙂
View GitHub Profile
using UnityEngine;
using System.Collections;
using System;
public class CustomEventArgs : EventArgs {
public string message;
}
public delegate void CustomEventHandler(object sender, CustomEventArgs e);
public class EventTest : MonoBehaviour {
$ sudo chown -R $USER /usr/local
$ brew doctor
@is8r
is8r / gist:77c8ae6380850ce9df6b
Created December 31, 2014 05:07
NSWindowを任意のクラスから呼び出す
var window: NSWindow! = NSApplication.sharedApplication().keyWindow
@is8r
is8r / gist:bb33a093f8c4558ea342
Created December 31, 2014 05:03
AppDelegateを任意のクラスから呼び出す
var appDelegate:AppDelegate = NSApplication.sharedApplication().delegate as AppDelegate
@is8r
is8r / gist:9780837a0ca526cbe0e7
Last active August 29, 2015 14:09
rbenvをアップデートして新しいのを入れる
$ sudo brew update
$ brew upgrade --HEAD ruby-build
$ rbenv install --list
$ rbenv install xxx
$ rbenv global xxx
or
$ rbenv local xxx
$ rbenv exec gem install bundler
@is8r
is8r / gist:0a97438089dc544d097e
Created November 8, 2014 13:13
railsのturbolink用
$(document).on('ready page:load', function() {
});
@is8r
is8r / gist:b169cf6914cb6c3be84d
Created October 25, 2014 05:54
jQueryでtrをソートする
function sortTrFilter(a, b) {
var _a = parseInt($(a).attr('data-id'));
var _b = parseInt($(b).attr('data-id'));
if (_a > _b) {
return 1;
} else {
return -1;
}
}
@is8r
is8r / gist:521fb9443b10023e953b
Last active August 29, 2015 14:06
オブジェクトの配列から特定の値を持っているオブジェクトを削除する
function filterKeyDelete(key, attr, ar) {
return function(i, index){
if (i[key] == attr) ar.splice(index, 1);
};
}
//howto
array.filter(filterKeyDelete('count', 1, array));
@is8r
is8r / gist:071b3d458f232fe54786
Created August 12, 2014 03:36
配列から重複する要素を削除
ar = ar.filter(
function (x, i, self) {
return self.indexOf(x) === i;
}
);
@is8r
is8r / gist:cd91196684a3d622fa85
Created August 12, 2014 03:35
配列から特定の文字列を含む要素を削除
ar = ar.filter(
function (x, i, self) {
return x.indexOf('hoge') !== -1;
}
);