This file contains 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
#!/usr/bin/env bash | |
###################################################### | |
# | |
# https://wiki.bash-hackers.org/howto/getopts_tutorial | |
# https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/ | |
###################################################### | |
function help() { | |
echo -e "Project Initial Setup....\n" | |
echo -e "Usage: $0 COMMAND [PARAMETERS]..." |
This file contains 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
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script> | |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
This file contains 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 {google} = require("googleapis"); | |
const path = require("path"); | |
// const {getCredentials} = require("./GoogleAuthenticator"); | |
// Requiring json file is not working here, as google.auth.getClient accepts file path | |
// let keyFile = require("./google-service-account-credentials.json"); | |
let keyFile = path.join(__dirname, "google-service-account-credentials.json"); | |
// console.log(keyFile); | |
let scopes = [ | |
'https://www.googleapis.com/auth/spreadsheets', |
This file contains 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
'use strict'; | |
let uuid = require("uuid"); | |
/** | |
* 'use strict'; | |
let uuid = require("uuid"); | |
module.exports = function (Todos) { | |
Todos.testTransaction = function () { | |
Todos.beginTransaction(Todos.Transaction.READ_COMMITTED, function (err, tx) { |
This file contains 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
'use strict'; | |
module.exports = function (Todos) { | |
Todos.validatesLengthOf('text', {min: 5, message: {min: 'text is too short'}}); | |
//create a test remote method and do field validations using Validate object | |
Todos.saveTodosData = function (text, done, cb) { |
This file contains 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
setInterval(function() { | |
console.log("foo"); | |
while (true) { | |
} | |
}, 1000); | |
setInterval(function() { | |
console.log("bar"); | |
}, 1000); |
This file contains 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
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-async-to-generator"] | |
} |
This file contains 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
//Author - Narendra Sisodiya - http://narendrasisodiya.com | |
//WHeN to use ? when async result from One Element is needed in another. | |
var sequentialProcess = function(arr, callback){ | |
var pp = Promise.resolve(); | |
arr.forEach(function(v, i, A){ | |
pp = pp.then(function(){ | |
return callback(v, i, A); | |
}); |