Skip to content

Instantly share code, notes, and snippets.

View frekw's full-sized avatar
🐼

Fredrik Wärnsberg frekw

🐼
  • https://soundtrack.io
  • Stockholm, Sweden
  • 07:42 (UTC +02:00)
View GitHub Profile
window.onerror = function(msg, url, line) {
_gaq.push(['_trackEvent', 'Error Log', msg, url + '_' + line]);
}
Backbone.sync.parsers({
MyDocumentsModel: {
url: "/documents",
parse: function(response){
return response.documents;
}
},
...
});
{
"models": [
{
"id": 1,
"title": "My Awesome Document",
"tags": ["note", "school"]
},
{
"id": 2,
"title": "My Other Document",
{
"models": [
{
"id": 1,
"title": "My Awesome Document",
"tags": ["note", "school"]
},
{
"id": 2,
"title": "My Other Document",
module("SC.TreeController - binding_bug", {});
test("observing a bound property in a treecontroller and using it to set its own 'content' property shouldn't cause an infinite loop", function(){
NameSpace = {};
NameSpace.a = SC.ArrayController.create({});
NameSpace.b = SC.TreeController.create({
counter: 0,
bar: null,
barBinding: 'NameSpace.a.content',
class MyBinaryTempFile < Tempfile
def initialize(name, *args)
# ...
super(name, :encoding => 'ascii-8bit')
# ...
end
end
<script type="text/javascript">String.preferredLanguage = "en";</script>
<script type="text/javascript" src="/static/sproutcore/debug/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/testing/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/runtime/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/datastore/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/empty_theme/en/current/javascript.js?1282864130"></script>
<script type="text/javascript" src="/static/sproutcore/ace/en/current/javascript.js?1282864130"></script>
<script type="text/javascript" src="/static/sproutcore/jquery/en/current/javascript.js?1282865868"></script>
<script type="text/javascript" src="/static/sproutcore/foundat
Function.prototype.curry = function() {
var fn = this, args = Array.prototype.slice.call(arguments);
return function() {
return fn.apply(this, args.concat(
Array.prototype.slice.call(arguments)));
};
};
var YES = true,
NO = false;
Function.prototype.curry = function() {
var fn = this, args = Array.prototype.slice.call(arguments);
return function() {
return fn.apply(this, args.concat(
Array.prototype.slice.call(arguments)));
};
};
var YES = true,
NO = false;
searchView: SC.TextFieldView.design({
layout: { centerX: 470, width: 205, height: 22, top: 40 },
hint: "Search",
leftAccessoryView: SC.ImageView.design({
layout: { left: 5, top: 3, width: 15, height: 15 },
//canLoadInBackground: YES,
valueIsUrl: YES,
value: sc_static('images/search-icon.png')
})
})