I hereby claim:
- I am fluffyjack on github.
- I am fluffyjack (https://keybase.io/fluffyjack) on keybase.
- I have a public key whose fingerprint is 8203 E7C0 359A 6B05 1787 ED6E C1C5 3A42 6E34 5928
To claim this, I am signing this object:
# Fibonacci numbers WITH memoization. | |
# Initialize the memoization hash. | |
@scratchpad = {} | |
@max_fibo_size = 1_000_000_000_000 | |
# Calculate the nth Fibonacci number, f(n). | |
def fibo (n) | |
val = if n <= 1 | |
n |
I hereby claim:
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project/template/ios' | |
require './lib/preprocessor' | |
begin | |
require 'bundler' | |
Bundler.require | |
rescue LoadError | |
end |
class UIView | |
def controller | |
if self.nextResponder.is_a? UIViewController | |
return self.nextResponder | |
elsif self.nextResponder.respond_to? :controller | |
return self.nextResponder.controller | |
end | |
end | |
end |
Using Ken Miller's benchmarking app: https://github.com/kemiller/rubymotion_benchmarking
ObjC native loop: 0.001162
ObjC native loop w/objc_msgSend: 0.001512
ObjC method called from ruby (raw): 0.028951
This is a current proposal that I'd like your feedback on for how we can clean up how we write RubyMotion applications. It's purely conceptual at the moment, and there would have to be some framework development to make this work the way described here.
Please submit your feedback, as a joint effort we can clean up our RubyMotion applications and make it easier for Rails developers to expand their skills into RubyMotion development.
The main points of this are:
class AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = MyViewController.new | |
@window.makeKeyAndVisible | |
true | |
end | |
end |
class PostRestStore < RestfulMotion::Store | |
api_endpoint 'http://example.com/v2/posts' | |
model :post | |
# some attribute mapping code | |
end |
This assumes you're using bubble-wrap
osx-plist
in your Gemfilebootstrap.rb
gist into your AppDelegate's application:didFinishLaunchingWithOptions:
methodrake
bootstrap.rb
features/step_definitions/location_services_steps.rb
location_services_steps.rb
in this gist$.getJSON("https://api.github.com/repos/rails/rails/stats/commit_activity", function(data) { | |
var week_count = 1; | |
var commits_by_week = data.map(function(week) { | |
var total = 0; | |
$.each(week['days'], function(k, v) { total += v }); | |
return total; | |
}); | |
$.each(commits_by_week, function (k, v) { | |
console.log("Week " + week_count + ": " + v + " commits"); | |
week_count++; |