Skip to content

Instantly share code, notes, and snippets.

View mauritslamers's full-sized avatar

Maurits Lamers mauritslamers

  • Den Haag, Netherlands
View GitHub Profile
{
apps: {
myapp: {
path: 'apps/myapp',
combineStylesheets: false
}
}
}
//or
var todos_one = SC.AppBuilder.create({
path: 'apps/todos_one'
});
var todos_two = SC.AppBuilder.create({
path: 'apps/todos_two'
});
init: function () {
//BT.util.log("init in BT.Framework for " + this.get('ref'));
this.files = BT.FrameworkFilesController.create({ framework: this });
this._scripts = BT.FrameworkScriptsController.create({ framework: this });
this._scripts.contentBinding = this._scripts.bind('content', this.files, 'scripts');
this._stylesheets = BT.FrameworkStylesheetsController.create({ framework: this });
this._stylesheets.contentBinding = this._stylesheets.bind('content', this.files, 'stylesheets');
var fwname = this.get('fullname');
var pathlib = require('path');
// don't forget to install nodejs
git clone git://github.com/mauritslamers/getting-started
cd getting-started
git checkout newbt
git submodule update --init
npm install
node_modules/sproutcore/bin/sproutcore
Then goto http://localhost:8080 and pick one...
.ace.toolbar {
-webkit-box-shadow: rgba(0, 0, 0, 0.3) 0 0 2px;
-moz-box-shadow: rgba(0, 0, 0, 0.3) 0 0 2px;
box-shadow: rgba(0, 0, 0, 0.3) 0 0 2px;
background-position: 0px -2803px;
background-repeat: repeat-x;
border-color: #999;
border-style: solid;
color: #505050;
text-shadow: 0 1px 1px white;
// somewhere in your data source:
someMethod: function () {
SC.Request.getUrl('http://your.url.here').json().notify(this, this._myCallbackMethod).send();
},
_myCallbackMethod: function (result) {
if (SC.ok(result)){
// successfully retrieved
var myData = result.get('body');
@mauritslamers
mauritslamers / index-bt.html
Created April 18, 2014 12:13
Differences between index.html generated by the new SproutCore BuildTools and Abbot
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<script>
var SC_benchmarkPreloadEvents = { headStart: new Date().getTime() };
var docElem = window.documentElement || document.documentElement;
if (docElem) { docElem.className = docElem.className.replace(/(^|\s)no-js(\s|$)/, '$1js$2');
docElem = null; }
</script>
@mauritslamers
mauritslamers / gist:11268530
Created April 24, 2014 20:31
race condition inside vm
24 Apr 22:01:13 - runInContext: dirname: /Users/maurits/Development/sproutcore/buildtools/getting-started/apps/todos_one
init in BT.Framework for /Users/maurits/Development/sproutcore/buildtools/getting-started/frameworks/sproutcore/frameworks/bootstrap
24 Apr 22:01:13 - setting back original dirname and filename
24 Apr 22:01:13 - runInContext: file turning back to: /Users/maurits/Development/sproutcore/buildtools/getting-started/sc_config
24 Apr 22:01:13 - runInContext: dirname: /Users/maurits/Development/sproutcore/buildtools/getting-started
in getting started sc_config, after sc_require: __dirname: /Users/maurits/Development/sproutcore/buildtools/getting-started/frameworks/sproutcore/frameworks/bootstrap
@mauritslamers
mauritslamers / core_state.js
Created April 24, 2014 20:49
auth check statechart
myApp.statechart = SC.Statechart.create({
rootState: SC.State.design({
initialSubstate: 'CHECKAUTH',
CHECKAUTH: SC.State.design({
<%
// # SPROUTCORE DEFAULT INDEX TEMPLATE
// # This template provide provides a basic wrapper for a SproutCore client.
// # Most of the time, it will be sufficient for your own needs. However, if
// # you need to create your own template, you can do so by copying this file
// # into your client, naming it 'index.rhtml' and then adding the options
// # :layout => 'lib/index' to your Buildfile.
// #
// # See the comments in this file for more information on what you can
// # change.