Skip to content

Instantly share code, notes, and snippets.

View geoffreyd's full-sized avatar

Geoffrey Donaldson geoffreyd

View GitHub Profile

Keybase proof

I hereby claim:

  • I am geoffreyd on github.
  • I am geoffreyd (https://keybase.io/geoffreyd) on keybase.
  • I have a public key whose fingerprint is 0452 62F1 55A0 1BD3 9641 673A 1CF9 1EC3 6307 8A1B

To claim this, I am signing this object:

/**
@property
This is the actual array of records in the current collection. This
property will change anytime the record members change (but not when
the member record properties change).
@type {Array}
*/
records: function() {
// ..........................................
// REFRESH
refreshRecords: function(records, options) {
if (!records || records.length == 0) return ;
if (!options) options = {} ;
records = records.byResourceURL() ; // group by resource.
for(var resource in records) {
if (resource == '*') continue ;
def self.first_uninteresting
last = 0
Number.all(:order => "number").each do |n| # Number.find/all will return an enumerable, so you can each it directly.
return last + 1 if n.number.to_i != last + 1 # if's can be on the same line at the end for basic tests
last = n.number.to_i #ops forgot the number casting
end
last + 1 # Ruby will automatically return the last valuation, no need for 'return'
end
#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)
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';
// }
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)
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
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
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},