- Tab indentation
- Single-quotes
- Semicolon
- Strict mode
- No trailing whitespace
- Multiple variable statements
- Space after keywords and between arguments and operators
- Return early
Re: On layout & web performance by Kelly Norton
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>#lazyweb Is there any documentation about which jQuery functions/effects trigger layout? re: kellegous.com/j/2013/01/26/l…
— Dave Rupert (@davatron5000) January 28, 2013
getWidthOrHeight()
used in jQuery.fn.width/height
clientLeft
- 3180 jQuery.event.mousehooks.filter
The Mediator pattern enables communication (mediation) between views using a mediator object.In the latest version of Backbone, the Backbone
object itself can be used as a mediator without the need of a seperate helper.
In the following example, triggerSomething
in our ToolbarView
uses the global event-bus on the Backbone
object to broadcast an application wide event somethingHappened
with data.
// First view
var ToolbarView = Backbone.View.extend({
className: ".toolbar",
events: {
"click .button": "triggerSomething"
- Open your Chrome Developer Tools
- Navigate to the Network tab
- Just right click into the panel and choose Copy ALL as HAR (maybe the page needs a reload)
- Switch to the console tab and save your HAR data in a variable. (
var data =
cmd + v) - Now let's create the cache manifest:
console.log('CACHE MANIFEST\n\nCACHE:');
I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.
- What is the primary setup? Is there an organization and each official repo is owned by that organization?
- Does every engineer have a fork of each repo they're working on?
- Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
- Do engineers work on feature branches on the main repo or on their own forks?
- Do you require engineers to squash commits and rebase before merging?
- Overall, what is the workflow for getting a new commit into the main repository?
- What sort of hooks do you make use of?
- Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
A timeline of the last four years of detecting good old window.localStorage
.
October 2009: 5059daa
var o = $({}); | |
$.subscribe = o.on.bind(o); | |
$.publish = o.trigger.bind(o); |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
user=`whoami` | |
# if installing node directly | |
sudo chown -R $user /usr/local/bin | |
sudo chown -R $user /usr/local/lib/node_modules | |
# if using nvm | |
sudo chown -R $user ~/.npm |