Skip to content

Instantly share code, notes, and snippets.

@averydev
averydev / controllers.application.js
Last active November 3, 2017 15:26
Listener test
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
on:false,
simpleOn:false,
actions:{
click(){
console.log("Click!");
},
@averydev
averydev / .block
Last active May 22, 2017 03:39
Isometric Test
license: gpl-3.0
objc[60124]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x10c19e998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x10bf1d880). One of the two will be used. Which one is undefined.
2017-02-10 13:03:34.090 Elevation Fitness[60124:69276564] I restkit:RKLog.m:49 RestKit logging initialized...
2017-02-10 13:03:34.154 Elevation Fitness[60124:69276564] Success excluding Elevation Fitness In House from backup
2017-02-10 13:03:34.161 Elevation Fitness[60124:69276564] [HockeySDK] WARNING: Detecting crashes is NOT enabled due to running the app with a debugger attached.
2017-02-10 13:03:34.190 Elevation Fitness[60124:69276564] SYNC: start
2017-02-10 13:03:34.193 Ele
@averydev
averydev / EmberFilterExample.js
Created December 23, 2016 00:10
How can this be refactored?
//controller
filtered: Ember.computed('filterFn', function (){
return this.get('filterFn')(this.get('allProducts'))
},
actions:{
updateFilter: function (newFilterFn){
this.set('filterFn', newFilterFn)
}
@averydev
averydev / components.input-component.js
Last active June 25, 2016 01:02
DDAU Input Field Pattern
import Ember from 'ember';
const {computed} = Ember;
export default Ember.Component.extend({
sourceProperty:null,
proxyProperty:computed('sourceProperty', {
get(key){
return this.get('sourceProperty');
},
{
"meta": {
"data_type": "array",
"item_type": "Doctor",
"total": 4,
"count": 4,
"skip": 0,
"limit": 10
},
"data": [
@implementation ELFFadeAndSlidePushAnimator
- (NSTimeInterval)transitionDuration:(id<UIViewControllerContextTransitioning>)transitionContext{
return 0.35;
}
-(void) animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext{
UIView * containerView = [transitionContext containerView];
NSTimeInterval duration = [self transitionDuration:transitionContext];
var doc = context.document;
for (var i = 0; i < doc.pages().count(); i++) {
var page = doc.pages().objectAtIndex(i);
for (var j = 0; j < page.artboards().count(); j++) {
var artboard = page.artboards().objectAtIndex(j);
@averydev
averydev / gist:11380185
Created April 28, 2014 18:31
ViewController template
#pragma mark - Standard VC state management
- (void)viewDidLoad
{
[super viewDidLoad];
/*
One-time setup tasks here
*/
}
<!-- Solution brought to you by Caroline Schnapp -->
<!-- See this: http://wiki.shopify.com/Related_Products -->
{% assign image_size = 'compact' %}
{% assign heading = 'Other fine products' %}
{% if product.tags.size > 0 %}
<h3>{{ heading }}</h3>
<ul class="related-products"></ul>