I hereby claim:
- I am dcporter on github.
- I am dcporter (https://keybase.io/dcporter) on keybase.
- I have a public key whose fingerprint is BD85 FE84 FD28 4326 485C 3B8C AFB1 B485 1093 B29C
To claim this, I am signing this object:
// A (quick and dirty) view which renders its content as a best-fit grid – that is, it shows all items, | |
// laid out as close to evenly as possible. | |
// Known issues: | |
// - doesn't update when content changes (wasn't part of my needs); easy observer fix | |
// - isn't a subclass of SC.CollectionView | |
// - someone with the maths could optimize the calculations | |
// - child views are never destroyed, only created and cached | |
BestFitGridView = SC.View.extend({ |
// ========================================================================== | |
// Project: SC.Timespan | |
// Copyright: @2013 My Company, Inc. | |
// ========================================================================== | |
/*globals SC */ | |
/** | |
Standard error thrown when trying to create a timespan with dates in | |
different timezones. |
// SC.Store (for autonomous nested stores) | |
SC.Store.reopen({ | |
chainAutonomousStore: function(attrs, newStoreClass) { | |
var newAttrs = attrs ? SC.clone( attrs ) : {}; | |
var source = this._getDataSource(); | |
newAttrs.dataSource = source; | |
return this.chain( newAttrs, newStoreClass ); | |
} | |
}); |
SC.ManyArray.reopen({ | |
// Set up observers. | |
contentDidChange: function() { | |
var observedRecords = this._observedRecords; | |
if (!observedRecords) observedRecords = this._observedRecords = []; | |
var record, i, len; | |
// If any items in observedRecords are not in content, stop observing them. | |
len = observedRecords.length; | |
for (i = len - 1; i >= 0; i--) { |
/* | |
View Transitions, new in SC1.0, have made all kinds of effects drop-dead easy. Here's | |
an ImageView which will fade nicely in when the image loads. | |
*/ | |
FadingImageView = SC.ImageView.extend({ | |
isVisible: NO, | |
isVisibleBinding: SC.Binding.oneWay('.status').transform(function(status) { return status === SC.IMAGE_STATE_LOADED; }), | |
transitionShow: SC.View.FADE_IN, | |
transitionShowOptions: { duration: 0.25 }, |
// ========================================================================== | |
// Project: LocalStorageDataSource For SproutCore | |
// Copyright: 2014 Dave Porter & contributors | |
// License: Licensed under MIT license | |
// ========================================================================== | |
window.DCP = window.DCP || {}; | |
/** @class | |
A data source which persists records to local storage. |
// ========================================================================== | |
// Project: SC.ProxiedArrayController | |
// Copyright: ©2014 My Company, Inc. | |
// ========================================================================== | |
/*globals SC */ | |
/** @class | |
This controller implements an experimental ArrayController pattern which wraps each item in a | |
controller object when retrieved. |
// relies on Date.now() which has been supported everywhere modern for years. | |
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values | |
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page | |
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed | |
(function(){ | |
// prepare base perf object |
I hereby claim:
To claim this, I am signing this object:
// A public observable | |
export const myObservable = RxJS.something( | |
// ? | |
); | |
// A function I can call any time to emit `val` from `myObservable` | |
function secretFunction(val) { | |
// ? | |
} |