:%!xxd
This file contains hidden or 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
/** | |
* The singleton pattern is a pattern used to restrict an object to a single instance. | |
* A singleton creates an instance of an object if that object does not exist. | |
* If it exists it returns the existing instance. | |
*/ | |
class Car { | |
constructor(model, year, miles) { | |
if(Car.exists){ | |
return Car.instance |
This file contains hidden or 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
// Conditional value | |
const a = { | |
...(someCondition && {b: 5}) | |
} | |
// Remove key from object | |
const postData = { | |
token: 'secret-token', | |
publicKey: 'public is safe', |
This file contains hidden or 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
// Copyright (c) 2018 AndreaSonny <[email protected]> (https://github.com/andreasonny83) | |
// | |
// This software is released under the MIT License. | |
// https://opensource.org/licenses/MIT | |
'use strict'; | |
const AWS = require('aws-sdk'); | |
const ses = new AWS.SES(); |
This file contains hidden or 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
{ | |
"name": "package-name", | |
"version": "0.0.0", | |
"description": "package-name short description", | |
"main": "lib/cli/index.js", | |
"bin": { | |
"package-name": "./bin/index.js" | |
}, | |
"scripts": { | |
"test": "jest --watchAll" |
This file contains hidden or 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
Array.prototype.mySum = function(callback) { | |
const vals = this; | |
const res = []; | |
for (var i = 0; i < vals.length; i++) { | |
res.push(callback(this[i])); | |
} | |
return res; |
This file contains hidden or 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
#!/bin/bash | |
# Find and rename all the modules files according to the target environment | |
env=${1-"dev"} | |
dir="src/app/components" | |
find $dir -name "*.$env.ts" -type f | while read file | |
do | |
base=$(basename $file) |
This file contains hidden or 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
# See http://help.github.com/ignore-files/ for more about ignoring files. | |
# compiled output | |
/dist | |
/tmp | |
/out-tsc | |
# Runtime data | |
pids | |
*.pid |
This file contains hidden or 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
find app/ -name '*.map' -exec sh -c 'rm "{}" ' \; # Remove all the .map files inside app/ | |
find . -name node_modules -exec rm -rf {} \; # Remove all node_modules from inside current folder and subfolders | |
ssh-add -L # Print Git ssh credentials | |
ssh-add ~/.ssh/id_rsa # Activate SSH credentials |