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
const userLocale = navigator.languages && navigator.languages.length ? navigator.languages[0] ?? 'en' : navigator.language ?? 'en'; | |
console.log(userLocale); |
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
- https://dev.to/jeetvora331/3-cool-developer-console-tricks-you-must-know-1ncc | |
- https://www.sitepoint.com/webpack-vite-migration/ |
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
/* | |
File: mongo-commands.js | |
Basic mongo Commands executed via script file | |
Usage: | |
$ mongo < mongo-commands.js | |
*/ | |
// showing the existing dbs.. | |
show dbs |
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
-- File: sql-commands.sql | |
-- Basic Sql Commands executed via script file | |
-- Usage: | |
-- $ mysql -u root -p < sql-commands.sql | |
-- # if already running in mysql | |
-- mysql> source sql-commands.sql | |
-- list databases | |
show databases; |
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
# script on command line arguments | |
# Usage: $ bash cli.sh <arg1> <arg2> ... | |
# multi-line comments | |
<<COMMENT | |
$@/$* : contains all the arguments | |
$0 : script name | |
$1,$2...$9 : positional parameters repr. arguments | |
$n : Nth argument | |
$# : total no.of arguments | |
$$ : pid of current shell |
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
# simple script on input && output | |
# Usage: $ bash io.sh (or) | |
# $ chmod +x io.sh $ ./io.sh | |
#!/bin/bash | |
# prints the string to stdout | |
echo "Enter Your Name:?" | |
# to read input from keyboard stores 'name' in name varaible |
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 | |
# sysinfo_page - A script to produce an HTML file | |
# Usage : sh test.sh > test.html | |
# Open 'test.html' in browser | |
title="System Information for" | |
cat <<- _EOF_ |
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
// Usage: mongo localhost/{DBName} mongo-list.js | |
var collections = db.getCollectionNames(); | |
print('Collections inside the db:'); | |
for(var i = 0; i < collections.length; i++){ | |
var name = collections[i]; | |
if(name.substr(0, 6) != 'system') | |
print(name + ' - ' + db[name].count() + ' records'); |
NewerOlder