Skip to content

Instantly share code, notes, and snippets.

View MelodicCrypter's full-sized avatar

Hugh Caluscusin MelodicCrypter

View GitHub Profile
@MelodicCrypter
MelodicCrypter / readline-with-stream.js
Created August 19, 2019 06:13
A NodeJS sample for readline with stream.
const readline = require('readline');
const rl = readline.createInterface(process.stdin, process.stdout);
const fs = require('fs');
const aPerson = {
name: '',
sayings: []
};
// ask a question, then use the callback to use the user's answer
@MelodicCrypter
MelodicCrypter / readline-sample.js
Created August 19, 2019 06:11
A simple NodeJS readline sample.
const readline = require('readline');
const rl = readline.createInterface(process.stdin, process.stdout);
const aPerson = {
name: '',
sayings: []
};
// ask a question, then use the callback to use the user's answer
rl.question('What is your name? ', (nameAnswer) => {
@MelodicCrypter
MelodicCrypter / uniqueGenerator.js
Last active August 8, 2019 13:04
A small javascript utility that will generate unique (hashed-type) strings.
// Your unique variables here
const allCapsAlpha = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"];
const allLowerAlpha = [..."abcdefghijklmnopqrstuvwxyz"];
const allUniqueChars = [...'~!@#$%^&*()_+`-=[]\\{}|;:\'",./<>?'];
const allNumbers = [..."0123456789"];
// This is the 'pattern', alternate the order if you want.
// The final output (order of pattern) will not be the same though,
// but you can improve this utility to achieve that.
const base = [...allCapsAlpha, ...allNumbers, ...allLowerAlpha, ...allUniqueChars];
@MelodicCrypter
MelodicCrypter / clean-fizzbuzz.js
Created April 25, 2019 15:17
Clean FizzBuzz code.
for (let i = 1; i < 100; i++) {
let res = '';
if (i % 3 === 0) { res += 'Fizz'; }
if (i % 5 === 0) { res += 'Buzz'; }
if (res === '') { res = i; }
console.log(res);
}
@MelodicCrypter
MelodicCrypter / proper-forking-repo.md
Last active January 24, 2019 15:04
Guide to properly fork a repository and how to pull latest changes from its original repository

Guide to properly fork a repository and how to pull latest changes from its original repository


{ This gist will help the ones that are still confused about forking a repository properly.
 Well, you might say that this is just an 'easy peasy' stuff for you, but not all are like you. 
 The purpose for this gist is share some guidance to how properly fork and then how to properly pull 
 the latest updates from the original repo. I hope this gist can help. }