Skip to content

Instantly share code, notes, and snippets.

View geoffreyd's full-sized avatar

Geoffrey Donaldson geoffreyd

View GitHub Profile
@geoffreyd
geoffreyd / core.js
Created October 26, 2010 08:35 — forked from jaehess/core.js
App = SC.Application.create(
/** @scope Chase.prototype */ {
NAMESPACE: 'App',
VERSION: '0.1.0',
// This is your application store. You will use this store to access all
// of your model data. You can also set a data source on this store to
// connect to a backend server. The default setup below connects the store
// to any fixtures you define.
App = SC.Application.create(
/** @scope Chase.prototype */ {
NAMESPACE: 'App',
VERSION: '0.1.0',
// This is your application store. You will use this store to access all
// of your model data. You can also set a data source on this store to
// connect to a backend server. The default setup below connects the store
// to any fixtures you define.
//Is this correct?
SC.ImageView.design({
// You don't need to have both a 'right' and a 'width', just one or the other
layout: { top: 100, left: 840, rotate: 90, height: 150, width: 130 },
value: static_url('resources/aly.JPG'),
localize: NO,
mouseDown: function(evt) {
// This will hide the current image when clicked
this.set('isVisible', YES) ;
@geoffreyd
geoffreyd / gist:183455
Created September 9, 2009 03:33
What a settable and gettable computed function should look like
firstName: SC.Record.attr(String),
lastName: SC.Record.attr(String),
fullName: function(key, newValue)
{
if(newValue) {
var names = newValue.split(" ");
this.set('firstName', names[0]);
this.set('lastName', names[1]);
return this;
layoutView : SC.SplitView.design({
layoutDirection: SC.LAYOUT_HORIZONTAL,
defaultThickness: 200,
layout: {bottom:0, top:0, left:0, right:0},
canCollapseViews: NO,
// the left view...
topLeftView: SC.SplitView.design({
layoutDirection : SC.LAYOUT_VERTICAL,
defaultThickness: 200,
layout: {bottom:0, top:0, left:0, right:0},
frameworks/sproutcore/frameworks/foundation/views/view.js: line 1371
/**
The layout describes how you want your view to be positions on the
screen. You can define the following properties:
- left: the left edge
- top: the top edge
- right: the right edge
- bottom: the bottom edge
module ActiveRecord
module NamedScope
class Scope
def conditions
@conditions ||= begin
all_conditions = []
scope = self
while scope.class == self.class
all_conditions << scope.proxy_options[:conditions]
scope = scope.proxy_scope
Sprout Casts:
All of these are focused on 1.0
- Make a blank app.
- setting up a model
- with some fixtures.
- Setup some views (a list, with a form)
compareObjects: function (v1, v2) {
var orderDefinition = [SC.T_ERROR, SC.T_UNDEFINED, SC.T_NULL, SC.T_BOOL, SC.T_NUMBER, SC.T_STRING, SC.T_ARRAY, SC.T_HASH, SC.T_OBJECT, SC.T_FUNCTION, SC.T_CLASS];
//function getType (v) {
// var t = typeof v;
// if (t == 'object') {
// if (t == null) return 'null';
// if (t instanceof Array) return 'array';
// }
#Ruby assignment option to assign unless nil
replacement_content = page_contents.content_label_find(item)
element.inner_html = replacement_content if replacement_content
# Should be able to do something like... not sure if the "=||" is the best suggestion for the assignment symbols
element.inner_html =|| page_contents.content_label_find(item)