Skip to content

Instantly share code, notes, and snippets.

View caridy's full-sized avatar

Caridy Patiño caridy

  • Salesforce, Inc.
  • Miami, FL.
  • X @caridy
View GitHub Profile

Installing Babel

The following are a few important npm packages.

Core Babel and access to Babel:

  • babel-core: the core compilation machinery and plugin infrastructure for Babel. You will rarely need to install this package, because other packages such as babel-cli have it as a dependency, meaning that it will be automatically installed when they are installed.

  • babel-cli: a command line interface to Babel. It includes the following commands:

  • babel-doctor detects common problems with your Babel installation.

%%RegistryPrototype%%[ @@iterator ]
%%RegistryPrototype%%.get(key) -> RegistryEntry
%%RegistryPrototype%%.set(key, module)
%%RegistryPrototype%%.has(key) -> boolean
%%RegistryPrototype%%.delete(key)
get %%RegistryEntryPrototype%%.stage -> "fetch" or "translate" or "instantiate" or "satisfy" or "link" or "ready"
get %%RegistryEntryPrototype%%.module -> module object or null
%%RegistryEntryPrototype%%.load(stage) -> promise
%%RegistryEntryPrototype%%.result(stage) -> promise or undefined
@jlongster
jlongster / immutable-libraries.md
Last active May 6, 2024 12:37
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@mapmeld
mapmeld / myanmar_nodejs_modules.md
Last active November 23, 2015 19:23
Myanmar language libraries / Asia Foundation

These JavaScript libraries have been super-helpful for our work in Myanmar. We are open-sourcing all of our work, and linking to local developers' open source work, too:

Zawgyi

We use knayi-myscript from GLO (Thuya Myo Nyunt)

You can get a command-line version here: knayi-cli.

For languages other than JavaScript, see more local developers' work on Rabbit Converter.

Promise.prototype.resolve = function() {
let loader = new Reflect.Loader();
let self = this;
loader[Reflect.Loader.resolve] = () => "whatevs";
loader[Reflect.Loader.fetch] = function(whatevs) {
return self;
};
return function(v) {
loader.load("whatevs"); // causes the loader to block on this promise for @@fetch
loader.provide(v); // causes the loader to resolve this promise
var Bar1 = base => class extends base {
componentWillMount(){
super.componentWillMount();
console.log('Bar1');
}
};
var Bar2 = base => class extends base {
componentWillMount(){
super.componentWillMount();
@WebReflection
WebReflection / String.prototype.template.js
Last active August 17, 2022 04:04
ES6 Template like strings in ES3 compatible syntax.
// this is now a module:
// https://github.com/WebReflection/backtick-template#es2015-backticks-for-es3-engines--
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
@ericf
ericf / CSP + SPDY Push.md
Last active August 29, 2015 14:05
CSP + SPDY Push

SPDY Push for Externalizing Dynamic Inline Scripts for CSP

This is a rough outline of some thoughts on how to leverage [SPDY Push][SPDY] externalize inline <script>s that contain dynamic, page/user-specific configuration and state data to align with [CSP][].

Problem

We are building web apps where the initial rendering (HTML) is built server-side, and in order for the client-side JavaScript app to take over, the app's configuration and initial state are written to an inline <script> element.

@domenic
domenic / removing-module-x-from-y.md
Last active August 29, 2015 14:02
Practical implications of removing `module x from "y"`

Practical Implications of Removing module x from "y"

Background

According to this gist, the modules break-out session at TC39 (a subset of the larger committee) decided to remove the

module x from "y";
@medikoo
medikoo / es6-shims.md
Last active March 24, 2021 22:29
List of ECMAScript 6 shims

List of ECMAScript 6 shims

Implemented on top of ECMAScript 5

Provided as distinct CJS modules, installable via npm


ECMAScript 5 Built-in Objects extensions

Individual modules of es5-ext package. See ES6 features for usage information.

Array