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
// Function to create a Google Sheet and send the link to the owner. | |
function createSheetAndSendLink(){ | |
// Create a new googleSheet | |
var ourSheet = SpreadsheetApp.create("ScriptSheet"); | |
Logger.log("ScriptSheet created successfully"); | |
// Get the URL of the sheet just created | |
var ourSheetUrl = ourSheet.getUrl(); | |
Logger.log("Sheet Url:"+ourSheetUrl); |
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
/** | |
* Method sets a new dataValidation rule across the sheet. | |
* | |
* @param {*} range | |
* @param {*} sourceRange | |
*/ | |
function depDrop_(range, sourceRange) { | |
var rule = SpreadsheetApp.newDataValidation().requireValueInRange(sourceRange, true).build(); | |
range.setDataValidation(rule); | |
} |
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
Source: https://dzone.com/articles/monitoring-with-prometheus | |
Components: | |
1) Prometheus Server | |
2) Target (Linux Machine) - Exporter (Node Exporter) | |
3) Visualization Layer (Grafana) | |
Prometheus has a main central component called Prometheus Server. | |
As a monitoring service, Prometheus servers monitor a particular thing. | |
That thing could be anything: it could be a an entire Linux server, a stand-alone Apache server, a single process, a database service or some other system unit that you want to monitor. |
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
Happy Path! | |
Create a new repository on Github. | |
Open terminal and change the working directory to the local project. | |
$ git init | |
$ git add . (To stage all the files in the local project directory) | |
$ git commit -m "First Commit" (To commit the files that were staged in the local directory) | |
Copy the remote URL from Github project page, it would be something like, "https://github.com/mechbullgt/hello-world.git" | |
$ git remote add origin <add the remote url here> | |
$ git remote -v (To verify is the remote urls are configured properly for the push & fetch) |
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
Step 1: remove all history (Make sure you have backup, this cannot be reverted) | |
cat .git/config # note <github-uri> | |
rm -rf .git | |
Step 2: reconstruct the Git repo with only the current content | |
git init | |
git add . | |
git commit -m "Initial commit" |
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
1) Show me the logs in the console. | |
console.log(); | |
2) To avoid clutter | |
foo ={}; | |
bar ={}; | |
console.log({foo, bar}); | |
3) Warn me, on console with the message | |
console.warn("Get the hell out"); |
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
//require mongoose module | |
var mongoose = require('mongoose'); | |
//require chalk module to give colors to console text | |
var chalk = require('chalk'); | |
//require database URL from properties file | |
var dbURL = require('./property').db; | |
var connected = chalk.bold.cyan; |
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
Reduce Bash prompt size by entering: PS1='\u:\W\$ ' |
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
Namaz Basics is a simple application to share valuable information to the first time learners and a quick reference for everyone else. | |
Namaz Basics, doesn't collect any personal data or uses any cookies to collection personally identifiable information about our users. |