// jQuery
$(document).ready(function() {
// code
})
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = new Marionette.Application(); | |
App.addRegions { | |
"headerRegion": "#header" | |
"topMenuRegion": "#top-menu" | |
"mainRegion" : "#main" | |
} | |
App.on 'initialize:after', -> | |
Backbone.history.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'marionette', | |
'router', | |
'controller', | |
'modules/auth', | |
'modules/vent', | |
'views/_layout' | |
], function(Marionette, Router, Controller, Auth, Vent, Layout){ | |
var App = new Marionette.Application(); |
- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ nano ~/.zshrc
- Add
path=('/path/to/depot_tools' $path)
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Debug/Checked compilation | |
const DEBUG = true; | |
function conditional(condition) { | |
return target => condition ? target : Function.prototype; | |
} | |
@conditional(DEBUG) | |
function assert(condition, message = "assertion failed.") { | |
if (!condition) throw new Error(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Frame extends Component { | |
componentDidMount() { | |
this.iframeHead = this.node.contentDocument.head | |
this.iframeRoot = this.node.contentDocument.body | |
this.forceUpdate() | |
} | |
render() { | |
const { children, head, ...rest } = this.props | |
return ( |