Dancing with Robots
?
Build Your Own AngularJS
I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.
TL;DR: Here's the solution I ended up with: https://github.com/filamentgroup/loadCSS/
For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: https://gist.github.com/igrigorik/2935269#file-notes-md ).
Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:
| // Open Script Editor and Export this as an Application | |
| // | |
| // Then drop a keynote file on it in the Finder and it will properly resize | |
| // and rotate everything so the Keynote file becomes usable as a prototype | |
| // in the iPhone keynote app | |
| // rotateDocument exported function | |
| // | |
| // Accepts a Keynote document and will rotate | |
| // all the slides and elements in the slide 90 degrees |
When the "Indent Text" menu item is selected, any cells within a single column selection will be indented by 5 spaces.
You can increase or decrease the number of spaces the text is indented by changing the line below so that the "5" is changed to a larger or smaller number (depending on your preference):
newValues.push(['=CONCAT(REPT( CHAR( 160 ), 5),"' + values[i][0] + '")']);| /** | |
| * Build for production: | |
| * $ NODE_ENV=production webpack | |
| * | |
| * Build for staging or development mode | |
| * $ webpack | |
| * | |
| * Run app server in dev mode and use Hot Module Replacement | |
| * $ NODE_ENV=webpack nodemon --watch ./app index.js | |
| * |
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#Understanding closures, callbacks and promises
For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.
10 months into my full-time dev career, and I would struggle to explain these words to a peer.
So I decided it was time to face my fears, and try to get my head around each concept.
Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.
| var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
| var path = require('path'); | |
| var webpack = require('webpack'); | |
| var noVisualization = process.env.NODE_ENV === 'production' | |
| || process.argv.slice(-1)[0] == '-p' | |
| || process.argv.some(arg => arg.indexOf('webpack-dev-server') >= 0); | |
| module.exports = { | |
| entry: { | |
| main: './reactStartup.js' |
| import React from 'react' | |
| import { func, node, number, object, shape, string } from 'prop-types' | |
| import { withRouter } from 'react-router' | |
| import debounceFn from 'lodash/debounce' | |
| class ScrollManager extends React.Component { | |
| static propTypes = { | |
| children: node.isRequired, | |
| history: shape({ | |
| action: string.isRequired, |