A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
/** | |
* Array Flat | |
* This a commonJS module written in ES6 that will flatten | |
* an array of arbitrarily nested arrays of | |
* integers into a flat array of integers. | |
* | |
* @example | |
* import arrayFlat from '/your/path/array-flat' | |
* | |
* flatten([0, 1, 3, [4, 5, 6, [4, 6]]]) |
function zip () { | |
const args = Array.prototype.slice.call(arguments) | |
const combinerFunction = args.pop() | |
const results = [] | |
const min = Math.min(...args.map(a => a.length)) | |
for (let counter = 0; counter < min; counter++) { | |
let values = args.map(o => o[counter]) | |
results.push(combinerFunction(...values)) | |
} |
Get rid off Syntax fix commits enabling your linter everytime a git commit try to be done.
This example features local eslint with js and jsx validation
Enable this hook creating or modifying the file /your/project/path/.git/hooks/pre-commit
#!/bin/sh
# Ensure all javascript files staged for commit pass standard code style
ROOT_DIR=$(git rev-parse --show-toplevel)
This is a way, recommended way by Nginx when creation redirections. i.e. you want to redirect from www to non-ww
server {
server_name www.mydomain.tld;
return 301 $scheme://mydomain.tld$request_uri;
}
server {
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 lead 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'