Skip to content

Instantly share code, notes, and snippets.

View ppcano's full-sized avatar

Pepe Cano ppcano

View GitHub Profile
@ppcano
ppcano / components.child-component.js
Created September 21, 2018 10:07 — forked from locks/components.child-component.js
Component template inheritance
import Ember from 'ember';
import Parent from './parent-component';
export default Parent.extend({
foo: 'baz'
});
@ppcano
ppcano / adapters.post.js
Last active October 19, 2017 14:34 — forked from fivetanley/adapters.post.js
inverse link is overwritten
import DS from 'ember-data';
export default DS.RESTAdapter.extend();
@ppcano
ppcano / Article.md
Created December 11, 2012 10:29 — forked from Warry/Article.md
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

require 'execjs'
class HandlebarsFilter < Filter
class << self
def contents
@@contents ||= [File.read("headless-ember.js"), File.read("ember.js")].join("\n")
end
def context
@@context ||= ExecJS.compile(contents)
@ppcano
ppcano / Assetfile
Created January 16, 2012 06:43 — forked from ebryn/Assetfile
input "app"
output "public"
(function(exports) {
window.DS = SC.Namespace.create();
})({});
(function(exports) {
DS.Adapter = SC.Object.extend({
commit: function(store, commitDetails) {
@ppcano
ppcano / gist:1434142
Created December 5, 2011 16:18 — forked from jakobdamjensen/gist:1433795
First attempt to do awesome collectionview
Mango.IssuesCollectionView = SC.View.extend({
reuseQueue: [],
backView: null,
content: null,
itemViewClass: SC.View,
topRowIndex: null,