Tribute for all of the lives loss in the Orlando attack @ Pulse nightclub. Mended heart using sass
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
const hasKey = (obj, key) => obj[key] === undefined; | |
const deepCloneObj = (obj) => JSON.parse(JSON.stringify(obj)); |
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
const date = new Date(); | |
date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); // E.g. 12:30 PM |
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
// Adding to the prototype so it can be used like a normal array method | |
Array.prototype.removeItem = function removeItem(item) { | |
const formattedItem = typeof item === 'string' ? item.trim().toLowerCase() : item; | |
const formattedItems = this.map((currentItem) => { | |
if (typeof currentItem === 'string') { | |
return currentItem.toLowerCase(); | |
}; | |
return currentItem; | |
}); |
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
const paymentMachine = Machine({ | |
id: 'payment', | |
initial: 'plan', | |
states: { | |
plan: { | |
initial: '$10', | |
states: { | |
'$10': { on: { SWITCH_PLAN: '$20' } }, | |
'$20': { on: { SWITCH_PLAN: '$10' } }, | |
hist: { type: 'history' }, |
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
// Ensure you have installed these two packages | |
const AWS = require('aws-sdk'); | |
const config = require('config'); | |
// this assumes that you have a config folder at the root of the project | |
// check more about node-config here: | |
// https://github.com/lorenwest/node-config | |
// if you're not using `config`, then the values from the .env file as shown below | |
// check sample config files contained in the config folder |
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
// let's try the old way | |
const arr1 = [1,2,3]; | |
const arr2 = [1,2,3]; | |
console.log(arr1 === arr2); // returns false | |
// Hello JSON.stringify()! | |
console.log(JSON.stringify(arr1) === JSON.stringify(arr2)); // true |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
<title>OCharge</title> | |
<link href="https://fonts.googleapis.com/css?family=Quicksand:300,400,700" rel="stylesheet"> | |
<!-- Bootstrap --> |