Loosely ordered with the commands used most towards the top. Sublime also offer full documentation.
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
Ctrl+⇧+↩ | insert line before |
Ctrl+⇧+↑ | move line (or selection) up |
Loosely ordered with the commands used most towards the top. Sublime also offer full documentation.
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
Ctrl+⇧+↩ | insert line before |
Ctrl+⇧+↑ | move line (or selection) up |
var spawn = require("child_process").spawn; | |
var Q = require("q"); | |
/** | |
* Wrap executing a command in a promise | |
* @param {string} command command to execute | |
* @param {Array<string>} args Arguments to the command. | |
* @param {string} cwd The working directory to run the command in. | |
* @return {Promise} A promise for the completion of the command. | |
*/ |
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
Sparked from this twitter conversation when talking about doing fast async rendering of declarative UIs in Preact
These examples show how it's possible to starve the main event loop with microtasks (because the microtask queue is emptied at the end of every item in the event loop queue). Note that these are contrived examples, but can be reflective of situations where Promises are incorrectly expected to yield to the event loop "because they're async".
setTimeout-only.js
is there to form a baseline"We need Webpack presets" and "Webpack and its plugins are too hard to configure correctly" have been the number one cause of developer pain shared with me from large sites adopting Progressive Web Apps and optimising their load performance.
If I was building a Webpack preset pack for performance, I might use the following:
new webpack.DefinePlugin({ 'process.env': env })
webpack.optimize.UglifyJsPlugin
#Capture and stream a webcam To capture using the iSight camera on a Mac, or infact any other webcam connected to the Mac, we can use FFmpeg. First get a list of the devices installed.
ffmpeg -f avfoundation -list_devices true -i ""
This will list the aviable video and audio devices.
The below will capture at 30fps and the set video size to a file.
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" out.avi
Did some experimentation to figure out how different browsers behave with regards to the srcset
and sizes
attribute in various browsers. Documented below.
Vanilla No AMP No CSS Example: https://codepen.io/cathyxz/pen/vbLrrE
<img srcset="https://placekitten.com/200/200 200w,
https://placekitten.com/300/300 300w,
#!/usr/bin/env python3 | |
from yaml import load, dump, FullLoader | |
import sys | |
file_name = sys.argv[1] | |
def process_ua(data): | |
for node in data: | |
if 'family_replacement' not in node: |