James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"
$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
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. | |
*/ |
img srcset => Enable a responsive images solution by providing the browser multiple resources in varying resolutions for a single image.
Arrow function => The arrow (=>) takes the place of the function keyword
Box Alignment => CSS properties for aligning boxes within their container. Allows for true vertical centering among other features.
DOM3 Keyboard Events => KeyboardEvent: keydown, keyup
Default parameter => Allows formal parameters to be initialized with default values if no value or 2 is passed.
var E_PREFIX_RATE = 0.25; | |
// All of our word lists: | |
var _word_lists = { | |
verb : [ | |
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace", | |
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize", | |
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate", |
/** | |
* @param {Function} fn Function to curry. | |
* @param {Number} lenght The arguments required to invoke the function. Optional. By default is fn.length | |
* @returns {Function} The currified function. | |
*/ | |
function curry(fn, length) { | |
length = length || fn.length; | |
return function currified() { | |
var args = [].slice.call(arguments); |
############################################################################### | |
# Helpful Docker commands and code snippets | |
############################################################################### | |
### CONTAINERS ### | |
docker stop $(docker ps -a -q) #stop ALL containers | |
docker rm -f $(docker ps -a -q) # remove ALL containers | |
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
# exec into container |
// Watch accesses/sets on a DOM element property. | |
function watchPropsOn(el) { | |
return new Proxy(el, { | |
get(target, propKey, receiver) { | |
//return Reflect.get(target, propKey, receiver); | |
console.log('get', propKey); | |
return el[propKey]; | |
}, | |
set(target, propKey, value, receiver) { | |
console.log('set', propKey, value); |
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