Skip to content

Instantly share code, notes, and snippets.

View fakestarbaby's full-sized avatar

Yoshinori Hirasawa fakestarbaby

View GitHub Profile
@fakestarbaby
fakestarbaby / file0.txt
Last active January 27, 2016 12:31
GitHub / GitLab で Unity 関連ファイルを折り畳んで楽々レビュー ref: http://qiita.com/fakestarbaby/items/c4f591062e5361b9b1a4
javascript:
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
$('.file-header').each(function(index, value) {
var path = $(value).data('path');
var ignores = ['.unity', '.meta', '.anim', '.controller', '.prefab', '.asset', '.mat', '.tpsheet'];
for (i = 0; i < ignores.length; i++) {
@fakestarbaby
fakestarbaby / private.xml
Created February 19, 2015 06:57
for Xamarin IDE: Karabiner.app で `Shift + _` を `_` に変換する
<?xml version="1.0"?>
<root>
<item>
<name>Change Shift_Underscore(_) to Underscore(_)</name>
<identifier>private.change_shift_underscore_to_underscore</identifier>
<autogen>
--KeyToKey--
KeyCode::JIS_UNDERSCORE, VK_SHIFT,
KeyCode::JIS_UNDERSCORE,
</autogen>
@fakestarbaby
fakestarbaby / gist:46f9e98526e1f69221f0
Created September 3, 2014 13:50
多項分布からサンプリングする
local function samplingFromMultinomialDistribution(probabilities)
local accumulateProbability = 0
local accumulateProbabilities = {}
for i = 1, #probabilities do
accumulateProbability = accumulateProbability + probabilities[i]
table.insert(accumulateProbabilities, accumulateProbability)
end
local random = math.random()
@fakestarbaby
fakestarbaby / Gemfile
Created April 1, 2014 18:35
i18n-tasks | Rails のロケールファイルを整理整頓する ref: http://qiita.com/fakestarbaby/items/d9ad517fe674059041cd
group :development do
gem 'i18n-tasks'
end
@fakestarbaby
fakestarbaby / file0.txt
Created December 17, 2013 13:20
Lua でテーブルの中身が空かどうか判定する ref: http://qiita.com/fakestarbaby/items/9c9f930fec89f5315b1a
table = {}
if not next(users) then
print("Table is empty.")
else
print("Table is not empty.")
end
local GA = require ("GameAnalytics")
true
false
@fakestarbaby
fakestarbaby / file0.txt
Created December 11, 2013 07:01
Lua で実行中のファイル名称と行番号を取得する ref: http://qiita.com/fakestarbaby/items/385c8a8a8b8f0db6d57c
local debugInfo = debug.getinfo(1)
local fileName = debugInfo.source:match("[^/]*$")
条件式 and 真の時の値 or 偽の時の値
@fakestarbaby
fakestarbaby / file0.txt
Created December 8, 2013 15:42
Rails アプリケーションテンプレート超意訳 ref: http://qiita.com/fakestarbaby/items/01c46a273725d0a48b36
$ rails new blog -m ~/template.rb
$ rails new blog -m http://example.com/template.rb