Skip to content

Instantly share code, notes, and snippets.

View topherfangio's full-sized avatar

Topher Fangio topherfangio

View GitHub Profile
@topherfangio
topherfangio / example.handlebars
Created August 25, 2011 21:11
Quick example of how to use SC.TemplateCollection ItemViews
{{#collection MyApp.ExampleCollectionView contentBinding="MyApp.myController.content"}}
{{view MyApp.MyButton class='mini right'}}
{{/collection}}
@topherfangio
topherfangio / app.js
Created August 26, 2011 15:30
Handlebars Text Binding
var App = SC.Application.create();
App.myVar = 'test';
App.BasicTextView = SC.View.extend({
textValue: null,
textValueDidChange: function() {
var jQuery = this.$();
topher@macbook:~/Documents/Development/Angelic/public/angelic$ bpm list
spade (1.0.2)
sproutcore-metal (2.0.beta.3)
sproutcore-runtime (2.0.beta.3)
jquery (1.6.2)
sproutcore-views (2.0.beta.3)
handlebars (1.0.0.beta.3)
sproutcore-handlebars-format (2.0.beta.3)
sproutcore-handlebars (2.0.beta.3)
sproutcore (2.0.beta.3)
topher@macbook:~/Documents/Development/Angelic/public/angelic$ bpm add sproutcore -v 2.0.beta.3.1
Fetching packages from remote...
Unfortunately, a fatal error has occurred. Please report this error to the BPM issue tracker at https://github.com/bpm/bpm/issues so that we can fix it. Thanks!
/Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems/requirement.rb:145:in `block in satisfied_by?': undefined method `call' for nil:NilClass (NoMethodError)
from /Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems/requirement.rb:145:in `each'
from /Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems/requirement.rb:145:in `all?'
from /Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems/requirement.rb:145:in `satisfied_by?'
from /Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems/source_index.rb:325:in `block in search'
from /Users/topher/.rvm/gems/ruby-1.9.2-p180/gems/libgems-0.1.3/lib/libgems
@topherfangio
topherfangio / base_model.js
Created December 6, 2011 15:15
SC1.6 & Sencha Touch 1.1
CORE360_PROPERTIES_TO_IGNORE = [ 'json_encodable', 'ext_data', 'attributes', 'readOnlyAttributes' ];
Core360.Model = SC.Record.extend({
ext_data: function() {
var hash = SC.clone(this.get('attributes'));
var property_keys = this.get('_properties');
if (SC.none(hash) || SC.none(property_keys)) {
return {};
@topherfangio
topherfangio / resizable_button.js
Created January 25, 2012 19:39
Simple SC.AutoResize example.
Pharos360.SelectButtonView = SC.SelectButtonView.extend(SC.AutoResize, {
supportsAutoResize: YES,
autoResizeLayer: function() { return this.get('layer') }.property('layer').cacheable(),
autoResizeText: function() { return this.get('longestChoice') }.property('longestChoice').cacheable(),
needsResize: YES,
longestChoice: "",
@topherfangio
topherfangio / gist:1929254
Created February 28, 2012 03:43
Intro for SC Guides: Getting Started 2
In Part 1, we walked through the basic pieces of a SproutCore app. In Part 2
we introduce some of the guiding concepts behind a SproutCore application
such as views, controllers, and statecharts.
In Part 2, you'll:
* Learn about statecharts and how they can improve your application.
* Create a new statechart-based SproutCore application.
* Learn about views and how they should handle events.
* Learn how to pass those events to the application's statechart.
@topherfangio
topherfangio / update_sproutcore_apps.sh
Created March 1, 2012 20:54
Updates SproutCore apps based off of a tar of the static directory.
# /bin/bash
release_path="https://some.great.url/sproutcore/static.tar"
echo "Removing old sproutcore files from git..."
rm -rf static
echo "Downloading static.tar from '$release_path' ..."
wget $release_path
@topherfangio
topherfangio / README
Created July 30, 2012 20:17
Notes on SlickGrid with Sproutcore
PLEASE NOTE: This is in regards to SlickGrid version 1.4.3; it appears a newer version is available, so your mileage may vary.
Using SlickGrid within Sproutcore requires a few steps:
1) Import the proper files as frameworks
2) Update the Buildfile appropriately
3) Create a basic wrapper class for the functionality you need
1 - So, the basic directory structure I used when importing the frameworks follows. I added two new directories, slickgrid and slickgrid_libs to hold them:
@topherfangio
topherfangio / design_modes.js
Created May 8, 2013 20:11
Design Modes API Thoughts
MyApp = SC.Application.create({
modes: {
phone: 350,
tablet: 900,
desktop: Infinity
}
});
MyApp.MyView = SC.View.extend({