Traveled by motorcycle (1300 miles roundtrip) from Boulder, CO to Kansas City, MO and back again.
- Keynote (Jeremy Daer)
- Didn't find this keynote to be of much value. It meandered and ran over allotted time.
Viz.WidgetsController = Ember.ArrayController.extend | |
init: -> | |
@refresh() | |
setInterval (=> @refresh()), 5000 | |
refresh: -> | |
$.ajax | |
url: @get('src'), | |
type: "GET", | |
context: this, |
I'm trying to write a complicated app in SC2. There's no editing component yet, just a display of (lots of data). Starting from the Todos & Handlebars guides, here's some of the stuff I've had to google for, or wasn't readily obvious.
Note: I like coffeescript and haml
Why is there sometimes references to SC.ArrayController
?
Why is App.fooController
an SC.Object
, and App.foosController
an SC.ArrayProxy
? Shouldn't there just be a generic SC.Controller
, or SC.CollectionController
, if the behavior is different?
require 'yajl' | |
module Ssaj | |
PARSER = Proc.new do |data| | |
HashWithIndifferentAccess.new(Yajl::Parser.parse(data)) | |
end | |
ActionDispatch::ParamsParser::DEFAULT_PARSERS[Mime::SSAJ1] = PARSER |
class MyResource | |
include Spinal::Resource | |
attribute :foo, String, :required => true | |
attribute :bar, Integer | |
render(:html).with(:template => 'my_resource') | |
render(:json).with(JsonRenderer) | |
def self.load(id) |
<h1><%= header %></h1> | |
<% if not item.empty? %> | |
<ul> | |
<% for i in item %> | |
<% if i[:current] %> | |
<li><strong><%= i[:name] %></strong></li> | |
<% else %> | |
<li><a href="<%= i[:url] %>"><%= i[:name] %></a></li> | |
<% end %> | |
<% end %> |
require 'pp' | |
# | |
# Cookbook Name:: postgres | |
# Recipe:: default | |
# | |
execute "init-postgres" do | |
command "if [ ! -d /var/lib/postgresql/8.3/data ]; then\nsu - postgres -c 'initdb -D /var/lib/postgresql/8.3/data'\nfi" | |
action :run | |
end |
class Instance | |
include DataMapper::Resource | |
class Adapter < AbstractAdapter | |
# define CRUD | |
end | |
@adapter = Adapter.new(:connection => foo) | |
repository DM.setup(@adapter) |
class DataMapper::Property | |
# translate the value from external source to expected object | |
def typecast(value) | |
value | |
end | |
# translate the value from the primitive to expected object | |
def load(value) | |
value |