Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
const jsdom = require("jsdom"); | |
const { JSDOM } = jsdom; | |
const dom = new JSDOM('<!DOCTYPE html><html><head></head><body></body></html>'); | |
global.window = dom.window; | |
global.document = dom.window.document; | |
// Simulate window resize event | |
const resizeEvent = document.createEvent('Event'); |
#!/usr/bin/env bash | |
# chrome-different-tz | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
An exploration of the different render methods available in react-enzyme.
# place this snippet into init.coffee in ~/.atom directory | |
atom.workspace.observeTextEditors (editor) -> | |
if editor.getTitle() isnt "untitled" | |
sp = editor.getPath().split('/') | |
title = sp.slice(sp.length-2).join('/') | |
editor.getTitle = -> title | |
editor.getLongTitle = -> title | |
for item in atom.workspace.getPaneItems() |
#!/usr/bin/env bash | |
# fresh-chrome | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
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
// go on you labels pages | |
// eg https://github.com/cssnext/cssnext/labels | |
// paste this script in your console | |
// copy the output and now you can import it using https://github.com/popomore/github-labels ! | |
var labels = []; | |
[].slice.call(document.querySelectorAll(".label-link")) | |
.forEach(function(element) { | |
labels.push({ | |
name: element.textContent.trim(), |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
[url "ssh://git@github.com/"] | |
insteadOf = gh: | |
[url "ssh://git@gist.github.com/"] | |
insteadOf = gist: | |
[url "git@bitbucket.org:"] | |
insteadOf = bb: | |
[url "gapple@git.drupal.org:project/"] | |
insteadOf = drupal: | |
[core] |