- Sign Up
- Credit Card Checkout
- Landing Page (above the fold)
- Calculator
- App Icon
- User Profile
- Settings
- 404 page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logColor(color, args) { | |
console.log(`%c ${args.join(' ')}`, `color: ${color}`); | |
} | |
const log = { | |
aliceblue: (...args) => { logColor('aliceblue', args)}, | |
antiquewhite: (...args) => { logColor('antiquewhite', args)}, | |
aqua: (...args) => { logColor('aqua', args)}, | |
aquamarine: (...args) => { logColor('aquamarine', args)}, | |
azure: (...args) => { logColor('azure', args)}, |
Douglas Crockford, author of JavaScript: The Good parts, recently gave a talk called The Better Parts, where he demonstrates how he creates objects in JavaScript nowadays. He doesn't call his approach anything, but I will refer to it as Crockford Classless.
Crockford Classless is completely free of class, new, this, prototype and even Crockfords own invention Object.create.
I think it's really, really sleek, and this is what it looks like:
function dog(spec) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple Phoenix authentication plug | |
# | |
# - based on Plug's session store | |
# - redirects unauthenticated requests to login page "/login/<request url>" | |
# - /static/... requests are not authenticated | |
# - authentication is valid as long as session is valid (you can change this behaviour easily) | |
# Because we need session to be fetched BEFORE this plug, we must put this to router.ex: | |
#---------------------------- |
This is not intended to be comprehensive or authoritative, just free online resources I've found valuable while learning more about Erlang.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Performs a binary search on the host array. This method can either be | |
* injected into Array.prototype or called with a specified scope like this: | |
* binaryIndexOf.call(someArray, searchElement); | |
* | |
* @param {*} searchElement The item to search for within the array. | |
* @return {Number} The index of the element which defaults to -1 when not found. | |
*/ | |
function binaryIndexOf(searchElement) { | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var extend = function(a, b) { | |
for (var i in b) | |
a[i] = b[i]; | |
return a; | |
}; | |
var fluent = function(f) { | |
return function() { | |
var clone = extend(Object.create(null), this); | |
f.apply(clone, arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ּ_בּ | |
בּ_בּ | |
טּ_טּ | |
כּ‗כּ | |
לּ_לּ | |
מּ_מּ | |
סּ_סּ | |
תּ_תּ | |
٩(×̯×)۶ | |
٩(̾●̮̮̃̾•̃̾)۶ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A simple Makefile alternative to using Grunt for your static asset compilation | |
# | |
## Usage | |
# | |
# $ npm install | |
# | |
# And then you can run various commands: | |
# | |
# $ make # compile files that need compiling | |
# $ make clean all # remove target files and recompile from scratch |