var color = d3.scaleOrdinal(d3.schemeCategory20);
var bubble = d3.pack(dataset)
.size([diameter, diameter])
.padding(1.5);
const { PerformanceObserver, performance } = require('perf_hooks'); | |
const objectSize = 10000; | |
const iterations = 100; | |
console.log("Starting performance test with %d object size and %d iterations", | |
objectSize, iterations); | |
const values = { | |
ENTRIES: 0, |
function getScrollParent(node) { | |
const isElement = node instanceof HTMLElement; | |
const overflowY = isElement && window.getComputedStyle(node).overflowY; | |
const isScrollable = overflowY !== 'visible' && overflowY !== 'hidden'; | |
if (!node) { | |
return null; | |
} else if (isScrollable && node.scrollHeight >= node.clientHeight) { | |
return node; | |
} |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
// Jeremie Miserez <[email protected]>, 2015 | |
// | |
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :) | |
// | |
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music | |
// | |
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist) | |
// | |
// 2. Open a developer console (F12 for Chrome). Paste | |
// code below into the console. |
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
There are a few JQL syntax bits to get you started:
AND
--- allows you to add qualifiers to a list!= Thing
--- target one thingis in (List, Of, Things)
--- target a bunch of things (Done, Closed, Resolved) typicallynot in (List, of, Things)
--- do not include a bunch of things-1w
--- relative time. You can also use -1d for day"2015/3/15"
--- specific dates
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
}; | |
NodeList.prototype.__proto__ = Array.prototype; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Somewhere in your controllers for this given example | |
// Example functions | |
$scope.itemOnLongPress = function(id) { | |
console.log('Long press'); | |
} | |
$scope.itemOnTouchEnd = function(id) { | |
console.log('Touch end'); | |
} |