Skip to content

Instantly share code, notes, and snippets.

View fakestarbaby's full-sized avatar

Yoshinori Hirasawa fakestarbaby

View GitHub Profile
@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 / 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 / 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 / mail.rb
Created August 9, 2011 13:07
Deviseで日本語メールを取り扱う方法
# config/initializers/mail.rb
class ActionMailer::Base
default 'Content-Transfer-Encoding' => '7bit'
end
@fakestarbaby
fakestarbaby / file0.txt
Created March 28, 2012 01:18
GitHub Pages+Octopressでブログを構築しよう! ref: http://qiita.com/items/0b7612ee83ceed805852
$ git clone git://github.com/imathis/octopress.git fakestarbaby.github.com
Cloning into fakestarbaby.github.com...
remote: Counting objects: 6310, done.
remote: Compressing objects: 100% (2340/2340), done.
remote: Total 6310 (delta 3593), reused 5890 (delta 3404)
Receiving objects: 100% (6310/6310), 1.28 MiB | 141 KiB/s, done.
Resolving deltas: 100% (3593/3593), done.
$ cd fakestarbaby.github.com
$ bundle install
Fetching gem metadata from http://rubygems.org/.......
@fakestarbaby
fakestarbaby / _config.yml
Created March 28, 2012 14:12
Octopressでツイートを表示させよう! ref: http://qiita.com/items/f8fe0220797f83fb8b56
# ----------------------- #
# 3rd Party Settings #
# ----------------------- #
# Twitter
twitter_user: fakestarbaby
twitter_tweet_count: 10
twitter_show_replies: false
twitter_follow_button: true
twitter_show_follower_count: false
@fakestarbaby
fakestarbaby / file0.txt
Created March 28, 2012 14:35
Octopressのテーマを変更してみよう! ref: http://qiita.com/fakestarbaby/items/ab532088453105e1bea4
$ git clone git://github.com/tommy351/Octopress-Theme-Slash.git .themes/slash
Cloning into .themes/slash...
remote: Counting objects: 730, done.
remote: Compressing objects: 100% (365/365), done.
remote: Total 730 (delta 400), reused 675 (delta 345)
Receiving objects: 100% (730/730), 221.25 KiB | 86 KiB/s, done.
Resolving deltas: 100% (400/400), done.
$ rake install['slash']
A theme is already installed, proceeding will overwrite existing files. Are you sure? [y/n] y
## Copying slash theme into ./source and ./sass
@fakestarbaby
fakestarbaby / _config.yml
Created March 28, 2012 14:14
OctopressでGoogleアナリティクスを使おう! ref: http://qiita.com/items/14785a63e064bb1306b9
# ----------------------- #
# 3rd Party Settings #
# ----------------------- #
# Google Analytics
google_analytics_tracking_id: UA-XXXXXXXX-X
@fakestarbaby
fakestarbaby / _config.yml
Created March 28, 2012 14:11
Octopressの初期設定をしよう! ref: http://qiita.com/items/8477493255caa7920112
# ----------------------- #
# Main Configs #
# ----------------------- #
url: http://FakeStarBaby.github.com
title: SCRABBLE NOTE
subtitle: 思うがままに書き殴るブログ
author: Yoshinori Hirasawa
simple_search: http://google.com/search
description:
@fakestarbaby
fakestarbaby / _config.yml
Created March 28, 2012 14:12
OctopressでGitHubリポジトリを表示させよう! ref: http://qiita.com/items/84c06cb30018d372c313
# ----------------------- #
# 3rd Party Settings #
# ----------------------- #
# Github repositories
github_user: fakestarbaby
github_repo_count: 3
github_show_profile_link: true
github_skip_forks: true