Skip to content

Instantly share code, notes, and snippets.

Avatar

Wesley Workman workmanw

View GitHub Profile
View binding_bug.js
Tce.mainPage = SC.Page.design({
// The main pane is made visible on screen as soon as your app is loaded.
// Add childViews to this pane for views to display immediately on page
// load.
mainPane: SC.MainPane.design({
childViews: 'myCustomView'.w(),
myCustomView: SC.View.design({
childViews: ['checkbox'],
View sample.js
// ==========================================================================
// Project: Sample
// Copyright: @2011 My Company, Inc.
// ==========================================================================
/*globals Sample */
Sample = SC.Application.create({
store: SC.Store.create().from(SC.Record.fixtures)
});
@workmanw
workmanw / tasks.js
Created Jul 22, 2011 — forked from tritchey/tasks.js
filtering
View tasks.js
ScaleUI.taskTagController = SC.ArrayController.create(
/** @scope ScaleUI.taskTagController.prototype */ {
queuedTasks: function() {
return content.filterProperty('state', TaskState.QUEUED);
}.property('@each.state').cacheable(),
runningTasks: function() {
return content.filterProperty('state', TaskState.RUNNING);
}.property('@each.state').cacheable(),
@workmanw
workmanw / followup.handlebars
Created Nov 30, 2011 — forked from lxcodes/followup.handlebars
Trouble With Sproutcore Template Views inside Core
View followup.handlebars
<div>
Hello, <b>{{text}}</b>!
</div>
@workmanw
workmanw / gist:1419845
Created Dec 1, 2011 — forked from tim-evans/gist:1419818
hashFor & guidFor optimizations
View gist:1419845
diff --git a/frameworks/runtime/core.js b/frameworks/runtime/core.js
index 2d12957..4b553f4 100644
--- a/frameworks/runtime/core.js
+++ b/frameworks/runtime/core.js
@@ -316,8 +316,6 @@ SC.mixin(/** @scope window.SC.prototype */ {
guidKey: "SproutCore" + ( SC.VERSION + Math.random() ).replace( /\D/g, "" ),
// Used for guid generation...
- _guidPrefixes: {"number": "nu", "string": "st"},
- _guidCaches: {"number": {}, "string": {}},
View gist:1424791
var g = require('../garcon/lib/garçon');
var server = g.Server.create({proxyHost: 'localhost', proxyPort: 8080});
var myapp;
var shouldBuild = false;
var stdHtmlBody = [
 '<div id="loading">',
   '<p id="loading">',
   'Loading…',
View gist:1443161
var g = require('../garcon/lib/garçon');
var myapp;
var combineScripts = false;
//var shouldBuild = false;
//var stdHtmlBody = [
//'<div id="loading">',
//'<p id="loading">',
//'Loading…',
@workmanw
workmanw / gist:1452536
Created Dec 9, 2011
Datastore example
View gist:1452536
MyApp = SC.Application.create({
store: SC.Store.create()
});
MyApp.MyRecord = SC.Record.extend();
MyApp.resourcePath = "myRecord";
// Load the record and save the storeKey
var storeKey = MyApp.store.loadRecord(MyApp.MyRecord, {});
View gist:1511429
var B = {
foo: function (original) {
console.log("Foo B");
original();
}.enhance()
};
var C = {
foo: function () {
console.log("Foo C");
@workmanw
workmanw / gist:1928558
Created Feb 28, 2012
Installing SproutCore from source (OS X and Linux)
View gist:1928558
Installing RVM:
1. Installing RVM is as easy as:
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
2. Add the following to your '.bash_profile':
# RUBY / RVM / SproutCore stuff
export RUBY_VERSION=ruby-1.9.2-head
export GEM_PATH=$HOME/.rvm/gems/ruby-1.9.2-head
source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
# It's best to open a new shell at this point so that your new variables are applied.
3. Instruct RVM to use Ruby 1.9.2: