I no longer mantain this list. There are lots of other very comprehensive JavaScript link lists out there. Please see those, instead (Google "awesome JavaScript" for a start).
Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).
env files look like this:
SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"
To source it:
$ source dev.env # or staging.env, or production.env, depending on where you're deploying to
const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x); | |
const fn1 = s => s.toLowerCase(); | |
const fn2 = s => s.split('').reverse().join(''); | |
const fn3 = s => s + '!' | |
const newFunc = pipe(fn1, fn2, fn3); | |
const result = newFunc('Time'); // emit! |
{ | |
"name": "My Progressive Web Application", | |
"short_name": "Progressive", | |
"start_url": "/?home=true", | |
"icons": [ | |
{ | |
"src": "/icons/icon36.png", | |
"sizes": "36x36", | |
"type": "image/png" | |
}, |
node_modules | |
build | |
npm-debug.log | |
.env | |
.DS_Store |
// class | |
class ClassCar { | |
drive () { | |
console.log('Vroom!'); | |
} | |
} | |
const car1 = new ClassCar(); | |
car1.drive(); |
/** | |
* cuid.js | |
* Collision-resistant UID generator for browsers and node. | |
* Sequential for fast db lookups and recency sorting. | |
* Safe for element IDs and server-side lookups. | |
* | |
* Extracted from CLCTR | |
* | |
* Copyright (c) Eric Elliott 2012 | |
* MIT License |
Here are seven JavaScript concepts you must understand before you go into your next JavaScript job interview:
-
Prototypes - JavaScript is a prototype-based language. Even more, it's a delegation-based system, which means that each object has a prototype chain. When you try to access a property on an object, and that property is not found, JavaScript looks at the object's prototype. The prototype is a delegate object, which means that the property lookup is delegated to the prototype object. That object, in turn, may have its own prototype. The search continues up the prototype chain until it reaches the root prototype, which is usually Object.prototype. The best feature of this system is that many object instances can share the same methods on a prototype object, which conserves memory and enables easy code reuse. To assign a prototype to a new object, you can use
Object.create(prototypeObject)
. Prototypal OO is the first course being offered in the "Learn JavaScript" series. -
Functional Programming
/* | |
A neuron is basically the sum of its synapses. | |
Along with a trigger threshold, that's all we need to calculate | |
whether or not it will trigger at any given moment: | |
*/ | |
const neuron = ({ synapses = [], threshold = 1 } = {}) => ({ | |
synapses, | |
threshold | |
}); |