🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs
bundle
✨ .d.ts
bundle + type-checking
🧐 Source maps
/** | |
* Taken from https://github.com/scrollback/juri | |
* | |
* Use of other URL-safe characters | |
* | |
* . Dot in strings | |
* _ Spaces in strings | |
* | |
* - Value: Start of negative number | |
* In numbers, negative exponent |
- "primitive":
boolean
,number
,string
,symbol
,null
,undefined
- "object" aka "non-primitive": any "custom object" (e.g.
{ foo: 1 }
) or function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types
(In JS, people mistakingly think of primitives as "object"s, but in strict JS terminology, they're not.)
With the addition of ES modules, there's now no fewer than 24 ways to load your JS code: (inline|not inline) x (defer|no defer) x (async|no async) x (type=text/javascript | type=module | nomodule) -- and each of them is subtly different.
This document is a comparison of various ways the <script>
tags in HTML are processed depending on the attributes set.
If you ever wondered when to use inline <script async type="module">
and when <script nomodule defer src="...">
, you're in the good place!
Note that this article is about <script>
s inserted in the HTML; the behavior of <script>
s inserted at runtime is slightly different - see Deep dive into the murky waters of script loading by Jake Archibald (2013)
Credit to @jkishner for https://gist.github.com/jkishner/2fccb24640a27c2d7ac9
Also interesting: https://gist.github.com/cdown/1163649
CREATE SEQUENCE public.global_id_seq; | |
ALTER SEQUENCE public.global_id_seq OWNER TO postgres; | |
CREATE OR REPLACE FUNCTION public.id_generator() | |
RETURNS bigint | |
LANGUAGE 'plpgsql' | |
AS $BODY$ | |
DECLARE | |
our_epoch bigint := 1314220021721; | |
seq_id bigint; |
- Atom is transitioning to an entirely new way of defining grammars using
tree-sitter
. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and checkUse Tree Sitter Parsers
Links for tree-sitter
help:
tree-sitter
: the main repotree-sitter-cli
: converts a JavaScript grammar to the required C/C++ filesnode-tree-sitter
: module to use Tree-sitter parsers in NodeJS- [My guide on starting a Tree-sitter grammar
Rebuild dokku nginx configuration with correct container IP addresses after system reboot until #2736 is released.
sudo curl -L -o /etc/systemd/system/dokku-redeploy-fix.service https://gist.github.com/ebeigarts/e3256021986f625acec62d9add04dfc3/raw/d85afd4e8beba843e273f4c8b7237c375a7eabea/dokku-redeploy-fix.service &&
sudo curl -L -o /usr/bin/dokku-redeploy-fix https://gist.github.com/ebeigarts/e3256021986f625acec62d9add04dfc3/raw/b4b3be7f3fdf51ba4e7716ac8cf04f40b97a762b/dokku-redeploy-fix.sh &&
sudo chmod +x /usr/bin/dokku-redeploy-fix &&
sudo systemctl enable dokku-redeploy-fix
// | |
// inspired by https://stackoverflow.com/a/838755/521197 | |
// | |
function getDPI() { | |
var div = document.createElement( "div"); | |
div.style.height = "1in"; | |
div.style.width = "1in"; | |
div.style.top = "-100%"; | |
div.style.left = "-100%"; | |
div.style.position = "absolute"; |