-- Simply set the offset to the amount of rows you want to keep. An index of (id, date desc) will make this fast. | |
delete from some_table st | |
using ( | |
select distinct | |
x.id, | |
x.date | |
from some_table st1 | |
join lateral ( |
// only polyfill .finished in browsers that already support animate() | |
if (document.body.animate) { | |
// Chrome does not seem to expose the Animation constructor globally | |
if (typeof Animation === 'undefined') { | |
window.Animation = document.body.animate({}).constructor; | |
} | |
if (!Animation.prototype.hasOwnProperty('finished')) { | |
Object.defineProperty(Animation.prototype, 'finished', { |
Warning this is purely a thought experiment and will probably go nowhere. The language semantics will likely be incongruent and non-rigourous. Proceed at your own risk.
Javascript always wanted to be a functional language. But for historical, political and perhaps even sensible reasons, JS's original mission was never truly fulfilled.
But what if, we take JS and start removing things. We can remove mutation, remove variables, remove classes, remove variadic signatures, remove default arguments and on and on.
What if we go back to ES1 and re-evaluate a future unperturbed by corporate circumstance.
The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.
Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.
This repo also contains a bundled version of npm that has a new command, asset
. You can read the documentation for and goals of that comma
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
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/
is intended for code that can run as-issrc/
is intended for code that needs to be manipulated before it can be used
[Unit] | |
Description=Demonstrate Bash | |
[Service] | |
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))" | |
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}" |