Skip to content

Instantly share code, notes, and snippets.

View prashant1k99's full-sized avatar
🏠
Working from home

Prashant Singh prashant1k99

🏠
Working from home
View GitHub Profile
@prashant1k99
prashant1k99 / docker-help.md
Created August 12, 2020 05:26 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

/**
* Encodes the string using base64.
* @param {string|number} str - The string to encode.
* @returns {string} The base64-encoded string.
*/
function base64encode(str) {
if (typeof str !== 'string') {
if (typeof str === 'number') {
str = str.toString();
} else {

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@prashant1k99
prashant1k99 / Clean-Js-Code.md
Created January 20, 2020 06:17
Clean Code Concept for Javascript
@prashant1k99
prashant1k99 / meta-tags.md
Created December 21, 2019 06:34 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@prashant1k99
prashant1k99 / regexp.js
Created November 29, 2019 07:20
Using RegExp in JS
//RegExp for URL validation - ^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$
let exp = ^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$;
function testInfo(phoneInput) {
var OK = exp.exec(phoneInput.value);
if (!OK)
window.alert(phoneInput.value + ' isn\'t a phone number with area code!');
else
window.alert('Thanks, your phone number is ' + OK[0]);
}
@prashant1k99
prashant1k99 / async-1.js
Created November 29, 2019 05:52
Async Await
async function f() {
return 1;
}
f().then(alert); // 1
@prashant1k99
prashant1k99 / alt-promises.js
Created November 29, 2019 05:47
Promises in JS
var promise = new Promise(function(resolve, reject) {
throw new Error('Some error has occured')
})
promise
.then(function(successMessage) {
console.log(successMessage);
})
.catch(function(errorMessage) {
//error handler function is invoked
/* Gist Embed - Dark Theme Styling - Thanks to MattD */
/* Body */
.gist-data tbody { background-color: Black; }
/* Line Numbers */
.gist-data tbody td:nth-of-type(1) {
color: #2B91AF !important;
}