Skip to content

Instantly share code, notes, and snippets.

@amazedkoumei
amazedkoumei / usage_old.rb
Created December 22, 2012 20:47
ブログ貼付用
# show view
@informView = InformView.new.tap do |v|
v.message = "loading...")
navigationController.view.addSubview(v)
end
@informView.showWithAnimation(true)
# hide view
@informView.hideWithAnimation(true)
@amazedkoumei
amazedkoumei / infrom_view_new.rb
Last active December 10, 2015 01:38
ブログ貼付用
# -*- coding: utf-8 -*-
class InformView < UIView
WIDTH = 280
HEIGHT = 100
# singleton
def self.instance
# warning at super in "init" method --version 1.29 > unknown: warning: passing a block to an Objective-C method - will be ignored
# Dispatch.once { @instance ||= new }
@amazedkoumei
amazedkoumei / sample_api.rb
Created December 18, 2012 08:04
ブログ貼付用
# -*- coding: utf-8 -*-
class SampleAPI
def initialize(content, &block)
@content = content
fetch do
block.call() if block
end
end
@amazedkoumei
amazedkoumei / Gemfile
Created December 9, 2012 22:15
pull req. for ruby lib.
# gem 'bubble-wrap', :require => 'bubble-wrap/all'
gem 'bubble-wrap', :git => 'https://github.com/amazedkoumei/BubbleWrap.git', :submodules => true, :require => 'bubble-wrap/all'
p NSJSONReadingMutableContainers # => 1
p NSJSONReadingMutableLeaves # => 2
p NSJSONReadingAllowFragments # => 4
opts = NSJSONReadingMutableContainers & NSJSONReadingMutableLeaves & NSJSONReadingAllowFragments
p opts # => 0
~/rubymotion/octofeed $rake retina=true --trace
rake aborted!
uninitialized constant BubbleWrap
/Users/amazedkoumei/.rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing'
/Users/amazedkoumei/rubymotion/octofeed/bundle/ruby/1.8/gems/bubble-wrap-1.1.4/lib/bubble-wrap/loader.rb:7
/Users/amazedkoumei/rubymotion/octofeed/bundle/ruby/1.8/gems/bubble-wrap-1.1.4/lib/bubble-wrap/all.rb:1:in `require'
/Users/amazedkoumei/rubymotion/octofeed/bundle/ruby/1.8/gems/bubble-wrap-1.1.4/lib/bubble-wrap/all.rb:1
/Users/amazedkoumei/.rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
/Users/amazedkoumei/.rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:68:in `require'
/Users/amazedkoumei/.rbenv/versions/1.8.7-p358/lib/ruby/gems/1.8/gems/bundler-1.2.1/lib/bundler/runtime.rb:66:in `each'
@amazedkoumei
amazedkoumei / added file list
Last active August 29, 2017 05:05
git command
# diffから"+++ or Binary files"を抽出
git diff master develop | grep "+++\|Binary files"
@amazedkoumei
amazedkoumei / gem-build.sh
Created October 7, 2012 15:30
ruby commands
j bubble
sudo gem build bubble-wrap.gemspec
sudo gem install bubble-wrap-1.1.4.gem
@amazedkoumei
amazedkoumei / tip.html
Created September 29, 2012 02:14
html tips
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<!-- deviceの横幅に合わせる -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
</body>
</html>
@amazedkoumei
amazedkoumei / error.log
Created September 27, 2012 18:46
ruby motion deploy error
$ rake device --trace
** Invoke device (first_time)
** Invoke archive (first_time)
** Invoke build:device (first_time)
** Execute build:device
** Execute archive
** Execute device
XCODE_DIR="/Applications/Xcode.app/Contents/Developer" /Library/RubyMotion/bin/deploy -d "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "./build/iPhoneOS-6.0-Development/clipTo.ipa"
log: subscribing to device notification
log: found usb mobile device XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX