Skip to content

Instantly share code, notes, and snippets.

View fabioricali's full-sized avatar
🏠
Beep beeeep

Fabio Ricali fabioricali

🏠
Beep beeeep
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active June 19, 2024 03:43
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@mrbar42
mrbar42 / README.md
Last active June 9, 2024 09:55
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@fabioricali
fabioricali / version-to-tag.sh
Last active September 26, 2017 16:59
Read version from package.json and add tag to git
#!/usr/bin/env bash
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
git commit -a -m "v$PACKAGE_VERSION"
git tag -a "v$PACKAGE_VERSION" -m "v$PACKAGE_VERSION"
git push --follow-tags
@jimmywarting
jimmywarting / readme.md
Last active June 18, 2024 16:00
Cors proxies
Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
@kripken
kripken / hello_world.c
Last active January 17, 2024 12:15
Standalone WebAssembly Example
int doubler(int x) {
return 2 * x;
}
@webarthur
webarthur / routes.js
Created July 24, 2016 14:29
pushState javascript router to vanilla js framework
var routes = (function(history){
var pushState = history.pushState;
history.pushState = function(state) {
typeof(history.onpushstate) == "function" && history.onpushstate({state: state});
setTimeout(routes.check, 10);
return pushState.apply(history, arguments);
};
@gokulkrishh
gokulkrishh / media-query.css
Last active June 18, 2024 18:06
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@ArjanSchouten
ArjanSchouten / HTML boolean attributes list
Last active May 7, 2021 12:14
Below is a list of html boolean attributes. All these attributes must be leaved empty, filed with 0|1, filled with on|off, filled with true|false or used as a flag.
async
autocomplete
autofocus
autoplay
border
challenge
checked
compact
contenteditable
controls
@yuval-a
yuval-a / js-micro.js
Last active May 16, 2024 21:01
Javascript micro-optimizations
NOTE: This document is OLD - and most of the tips here are probably outdated, since newer versions of Javascript have been
released over the years - with newer optimizations and more emphasis on optimizing newly supported syntax.
// Array literal (= []) is faster than Array constructor (new Array())
// http://jsperf.com/new-array-vs-literal/15
var array = [];
// Object literal (={}) is faster than Object constructor (new Object())
// http://jsperf.com/new-array-vs-literal/26