One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| license: gpl-3.0 |
| //hexaTime.js | |
| //author: imixtron | |
| //Javascript function to return unique hexadecimal string (that i personally use) | |
| function getUniqueKey(){ | |
| return ((new Date).getTime()).toString(32); | |
| } | |
| var unique_key = getUniqueKey() |
| #!/bin/bash | |
| MONGO_DATABASE="your_db_name" | |
| APP_NAME="your_app_name" | |
| MONGO_HOST="127.0.0.1" | |
| MONGO_PORT="27017" | |
| TIMESTAMP=`date +%F-%H%M` | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| BACKUPS_DIR="/home/username/backups/$APP_NAME" |
| //server; /api/ | |
| var APP_PREFIX = 'pMeds_', | |
| APP_URL = '/api/', | |
| APP_TIMEOUT = 1000 * 30, | |
| HTTP_REQUEST = null, | |
| APP_DATA = {}; | |
| APP_FORMAT = 'json'; | |
| var API = { |
| /** | |
| * Time Difference takes input in Hours Format | |
| * Author: imixtron | |
| * Accepts: String Values (HH:MM) | |
| * Max: 24:00, Min: 00:00 | |
| * | |
| * example timeDifference("10:37","12:35") | |
| */ | |
| timeDifference(from, to) { |
| function getDomPath(el) { | |
| var stack = []; | |
| while ( el.parentNode != null ) { | |
| console.log(el.nodeName); | |
| var sibCount = 0; | |
| var sibIndex = 0; | |
| for ( var i = 0; i < el.parentNode.childNodes.length; i++ ) { | |
| var sib = el.parentNode.childNodes[i]; | |
| if ( sib.nodeName == el.nodeName ) { | |
| if ( sib === el ) { |
| #!/bin/bash | |
| kubectl get <resource-type> <resource-name> -n <source-namespace-name> -o yaml |\ | |
| sed 's/namespace: <source-namespace-name>/namespace: <target-namespace-name>/' |\ | |
| kubectl create -f - | |
| > Example: | |
| kubectl get secret auth-token -n web-dev -o yaml |\ | |
| sed 's/namespace: web-dev/namespace: web-qa/' |\ | |
| kubectl create -f - |
| array=( chg8p p9dzh ); \ | |
| loc="/bin/"; \ | |
| for i in "${array[@]}"; \ | |
| do echo $i; \ | |
| mv $i $loc | |
| done |
| // small function to get routes from an express router | |
| // https://stackoverflow.com/questions/14934452/how-to-get-all-registered-routes-in-express#answer-26275395 | |
| export function listRoutes(...args: Router[]){ | |
| for (var i = 0; i < arguments.length; i++) { | |
| if(arguments[i].stack instanceof Array){ | |
| console.log(''); | |
| arguments[i].stack.forEach(function(a: any){ | |
| var route = a.route; | |
| if(route){ |