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 / async-1.js
Created November 29, 2019 05:52
Async Await
async function f() {
return 1;
}
f().then(alert); // 1
@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 / 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 / Clean-Js-Code.md
Created January 20, 2020 06:17
Clean Code Concept for Javascript

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?

/**
* 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 {

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@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

@prashant1k99
prashant1k99 / docker_wordpress.md
Created August 12, 2020 05:27 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@prashant1k99
prashant1k99 / add-rsync-to-git-bash.md
Created November 6, 2020 07:20 — forked from hisplan/add-rsync-to-git-bash.md
Add rsync to git bash for windows