This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @brief | |
* htmlタグにおけるcanvasでのヘルパー関数 | |
*/ | |
/** | |
* @brief 頂点設定 | |
* @param ctx Canvasインスタンス | |
* @param vtx Array型頂点配列 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// view controller wrapping function | |
/** | |
* プレゼントビューコントローラーのラッピング関数 | |
* @param me 呼び出すを行うビューコントローラー(基本的にはselfを指定) | |
* @param vc 呼び出しをされるビューコントローラー | |
* @param flag アニメーションフラグ | |
* @param comp 終了後に呼ぶブロック関数 | |
*/ | |
void presentViewController(UIViewController* me, UIViewController* vc, BOOL flag, void* comp) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// これだとアウト | |
- (bool)loadFunc1 { | |
NSUserDefaults* ud = [NSUserDefaults standardUserDefaults]; | |
NSArray* ary = [ud arrayForKey:load_name]; | |
if(ary) { | |
NSMutableArray* lists = [[NSMutableArray alloc] initWithArray:ary]; | |
return true; | |
} else { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add_area | |
= link_to '+', '', id: 'plus' | |
javascript: | |
$(function(){ | |
$(document).on('click', '#plus', function(){ | |
$('#add_area').append('<div class="col-sm-10"><input type="text" class="form-control" /></div>') | |
return false; | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vi | |
brew install vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function() { | |
var canvas = document.createElement('canvas'); | |
canvas.width = 640; | |
canvas.height = 480; | |
document.body.appendChild(canvas); | |
var context = canvas.getContext('2d'); | |
var player = Object(); | |
var obstacles = [Object(), Object(), Object()]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hoge.first.try(:name) | |
# => メソッドや変数の呼び出しで、objがnilでも例外を発生させずに通れる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y update | |
sudo yum -y git openssl-devel make vim gcc cmake readline-devel zlib-devel | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo -e 'export PATH="$HOME/.rbenv/bin:$PATH"\neval "$(rbenv init -)"' >> ~/.bash_profile | |
source ~/.bash_profile | |
CONFIGURE_OPTS="--disable-install-rdoc" rbenv install 2.5.1 | |
rbenv global 2.5.1 | |
gem install bundler --no-ri --no-rdoc | |
rbenv rehash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'therubyracer' | |
gem 'less-rails' | |
gem 'twitter-bootstrap-rails' | |
# rails g bootstrap:install | |
gem 'bootstrap-sass' | |
gem 'sass-rails' | |
# application.css -> application.scss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# デフォでコメントアウトされてるの外すだけ | |
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } | |
RSpec.configure do |config| | |
config.include WaitFor | |
end |
OlderNewer