Note: this rough draft has turned into https://github.com/maxogden/art-of-node#art-of-node
go to https://github.com/maxogden/art-of-node#art-of-node to view the newer versions of this document
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
if (typeof (AC) === "undefined") { | |
AC = {} | |
} | |
AC.Detector = { | |
getAgent: function () { | |
return navigator.userAgent.toLowerCase() | |
}, | |
isMac: function (c) { | |
var d = c || this.getAgent(); | |
return !!d.match(/mac/i) |
go to https://github.com/maxogden/art-of-node#art-of-node to view the newer versions of this document
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
This is a simplified version of the Code Styleguide used at Seven West Media where we use Glamorous for styles on https://thewest.com.au and http://www.perthnow.com.au
All styled items should have a separate file in the componets folder named according to the component name e.g. heading.styled.tsx
Sub-components should exist in a separate folder with the components folder called component
If there is more than one component, components should be put into their own files