In Ember, the application's state manager handles routing. Let's take a look at a simple example:
App.stateManager = Ember.StateManager.create({
start: Ember.State.extend({
index: Ember.State.extend({
route: "/",
Paul Rand | |
• Design is the method of putting form and content together. Design, just as art, has multiple definitions; there is no single definition. Design can be art. Design can be aesthetics. Design is so simple, that's why it is so complicated. | |
• Providing, meaning to a mass of unrelated needs, ideas, words and pictures - it is the designer's job to select and fit this material together and make it interesting. | |
• Simplicity is not the goal. It is the by-product of a good idea and modest expectations. | |
Shigeo Fukuda |
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
class String | |
def to_bool | |
return true if self == true || self =~ (/(true|t|yes|y|1)$/i) | |
return false if self == false || self.blank? || self =~ (/(false|f|no|n|0)$/i) | |
raise ArgumentError.new("invalid value for Boolean: \"#{self}\"") | |
end | |
end |
config.action_controller.asset_host = Proc.new { |source, request = nil, *_| | |
request && request.ssl? ? 'https://s3.amazonaws.com/my_bucket' : 'http://s3.my-domain.com' | |
} |
1/ rails generate controller controller_name --assets=false | |
or | |
2/ Add these lines to application.rb: | |
config.generators.stylesheets = false | |
config.generators.javascripts = false |
1/ Create a box file | |
vagrant box add uitl http://dl.dropbox.com/u/8072848/centos-5.7-x86_64.box | |
2/ vagrant init | |
3/ vagrant up | |
4/ vagrant ssh | |
5/ vagrant box list |
Fix SSL certificate error when installing RVM on Centos | |
echo insecure >> ~/.curlrc | |
and then install as normal |
Start XCode and create a new Storyboard file. I closed all my other XCode projects. When you choose the location of the created file, it should be your RubyMotion project's resources
directory. Add a UIViewController, and set it's identifier property to "Start"
. Add some UI elements so you can see it working.
When you run rake in your RubyMotion project, it will compile the .storyboard
file. You could auto-load the Storyboard using a plist configuration, but you'll see code can do it too.
watch /src\/.*\.haml/ do |md| `thor convert:haml` end | |
watch /src\/.*\.rb/ do |md| `thor convert:haml` end | |
watch /src\/.*\.scss/ do |md| `thor convert:sass` end | |
watch /src\/.*\.sass/ do |md| `thor convert:sass` end | |
watch /src\/.*\.coffee/ do |md| `thor convert:coffee` end |