function Book({name, author, year}) {
const constructor = {
getTitle: function() {
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
git clone [email protected]:<user|org>/<src-repo>.git
cd <src-repo>
git remote rm origin
git filter-branch --subdirectory-filter -- -- all
I hereby claim:
- I am thinkholic on github.
- I am thinkholic (https://keybase.io/thinkholic) on keybase.
- I have a public key ASBnhPdIw8TKISqTf0fcisC4vS0eIjr90WWjm7RvpXlQygo
To claim this, I am signing this object:
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
Object.prototype.isEmpty = function() { | |
var obj = this; | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) return false; | |
} | |
return 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
class Validator { | |
schema = null; | |
constructor(schema) { | |
this.schema = schema; | |
} | |
run(values) { | |
const schema = this.schema; | |
const errors = {}; |
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
// JS/nodejs version for aunyks/snakecoin.py | |
// Original: https://gist.github.com/aunyks/8f2c2fd51cc17f342737917e1c2582e2 | |
const sha256 = require('js-sha256'); | |
// Define the Block Class | |
class Block { | |
constructor(index, data, previousHash) { | |
this.index = index; | |
this.timestamp = new Date(); |
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
toTitleCase(str: string) { | |
console.log('str: ', str); | |
return str.toLowerCase().split(' ').map(function(word) { | |
return (word.charAt(0).toUpperCase() + word.slice(1)); | |
}).join(' '); | |
} | |
https://medium.freecodecamp.org/three-ways-to-title-case-a-sentence-in-javascript-676a9175eb27 |
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 helloEmail(){ | |
// var helper = require('sendgrid').mail | |
// from_email = new helper.Email("[email protected]") | |
// to_email = new helper.Email("[email protected]") | |
// subject = "Hello World from the SendGrid Node.js Library" | |
// content = new helper.Content("text/plain", "some text here") | |
// mail = new helper.Mail(from_email, subject, to_email, content) | |
// email = new helper.Email("[email protected]") | |
// mail.personalizations[0].addTo(email) |
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
.alerts {} /* block */ | |
.alerts__error {} /* element */ | |
.alerts--show {} /* state */ |
NewerOlder