A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
import {ReadableStream} from 'node:stream/web'; | |
/** | |
* @param iterable an iterable (asynchronous or synchronous) | |
* | |
* @see https://streams.spec.whatwg.org/#example-rs-pull | |
*/ | |
function iterableToReadableStream(iterable) { | |
return new ReadableStream({ | |
async start() { |
##### https://flake8.pycqa.org/en/latest/user/configuration.html | |
[flake8] | |
ignore = | |
# D100: Missing docstring at top of file | |
D100, | |
# D104: Missing docstring in __init__.py | |
D104, | |
# D401: Docstring first line should be imperative | |
D401, | |
# D101 Missing docstring in public class |
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
A simple script with a few niceties that allows for multiple requestAnimationFrame
calls, and FPS pinning.
The script polyfills rAF if required, then overloads requestAnimationFrame
and cancelAnimationFrame
with a process that allows multiple frames to be queued up for rAF to run.
This is useful if there are multiple animations running on the page, you want all the callbacks to happen at once, and not on multiple rAF calls. This script is meant as a drop-in solution to that problem.
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
set list listchars=tab:\ \ ,trail:· |
<?php | |
use Zend\Db\Sql\Select; | |
// basic table | |
$select0 = new Select; | |
$select0->from('foo'); | |
// 'SELECT "foo".* FROM "foo"'; | |