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 sh | |
goclean() { | |
local pkg=$1; shift || return 1 | |
local ost | |
local cnt | |
local scr | |
echo "Clean removes object files from package source directories (ignore error)" | |
go clean -i $pkg |
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 sh | |
sudo pkill loginwindow |
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 sh | |
APP_VER="19.9.20" | |
version() { | |
echo " Version $APP_VER \n" | |
} | |
help() { | |
echo "\n Apache Tomcat Agent version $APP_VER \n Copyright (c) 2019 Abhishek Kumar. All rights reserved." | |
echo "\n Options:" |
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 http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"); | |
const mimeTypes = { | |
html: "text/html", | |
jpeg: "image/jpeg", | |
jpg: "image/jpeg", | |
png: "image/png", |
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
/* | |
DURATION | |
Calculates the exact duration in between 2 given dates. | |
Copyright (c) 2020 Abhishek Kumar. | |
Protected by Creative Commons license (CC BY 4.0). | |
@file duration.js | |
@author Abhishek Kumar | |
*/ |
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
/* | |
GFKeyFetcher | |
Google Form Key Fetcher | |
Copyright (c) 2014 Nistush Tech Solution. | |
Protected by Creative Commons license (CC BY 4.0). | |
@file GFKeyFetcher.js | |
@author Abhishek Kumar | |
*/ |
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
/* | |
WSPM | |
Web Shell Package Manager | |
Copyright (c) 2020 Abhishek Kumar. | |
Protected by Creative Commons license (CC BY 4.0). | |
@file wspm.js | |
@author Abhishek Kumar | |
*/ |
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 flags = { _: [] }; | |
process.argv.forEach((s, e) => { | |
if (e >= 2) | |
if (/^[\-\-]{1,2}.+[\=\:].*$/.test(s)) { | |
let e = s.split(/[\=\:]/), | |
l = e[0].lastIndexOf("-"); | |
l < 2 && (flags[e[0].substring(l + 1)] = e[1]); | |
} else if (/^[\-\-]{1,2}.+$/.test(s)) { | |
let e = s.lastIndexOf("-"); | |
e < 2 && (flags[s.substring(e + 1)] = !0); |
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
function convertArrayToCSV(arr) { | |
const arrayCopy = [...arr]; | |
const header = arrayCopy.shift(); | |
const csv = [ | |
header.join(','), | |
...arrayCopy.map((row) => row.join(',')), | |
].join('\n'); | |
return csv; | |
} |
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
function convertArrayOfObjectsToCSV(data) { | |
const arrayCopy = [...data]; | |
const header = Object.keys(arrayCopy[0]); | |
const csv = [ | |
header.join(','), | |
...arrayCopy.map((row) => { | |
return header.map((fieldName) => { | |
let cellValue = row[fieldName] !== undefined ? row[fieldName] : ''; | |
if (typeof cellValue === 'string') { | |
cellValue = cellValue.replace(/"/g, '""'); |
OlderNewer