Skip to content

Instantly share code, notes, and snippets.

View isurfer21's full-sized avatar

Abhishek Kumar isurfer21

View GitHub Profile
@isurfer21
isurfer21 / tomcat
Last active December 11, 2019 02:22
Shell based Apache Tomcat agent
#!/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:"
@isurfer21
isurfer21 / goclean
Created September 20, 2019 05:05
Golang package cleaner
#!/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
@isurfer21
isurfer21 / logout
Created September 20, 2019 05:16
Logout from macOS via Terminal command
#!/usr/bin/env sh
sudo pkill loginwindow
@isurfer21
isurfer21 / vitaarak.js
Last active December 11, 2019 02:26
Vitaarak is a zero dependency node.js based mime-type supported simple HTTP server with CLI and made for quick integration in any dev project.
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",
@isurfer21
isurfer21 / flame.js
Last active April 18, 2023 11:25
It is a legacy game of FLAME, that children and teenagers use to play on their crushes. The theory of flame states that it could forecast the relationship in between 2 person by doing a flame-test on their individual names.
/*
The Legacy Game of FLAME
Copyright (c) 2015 Nistush Tech Solution.
Protected by Creative Commons license (CC BY 4.0).
@file flame.js
@author Abhishek Kumar
*/
export function flame(argv) {
@isurfer21
isurfer21 / duration.js
Created February 11, 2020 07:41
Calculates the exact duration in between 2 given dates.
/*
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
*/
@isurfer21
isurfer21 / wspm.js
Last active February 18, 2020 16:47
Web Shell Package Manager
/*
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
*/
@isurfer21
isurfer21 / GFKeyFetcher.js
Last active February 18, 2020 11:39
GFKeyFetcher is a node.js based CLI tool to fetch input field label & name as key-value pair from Google Form
/*
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
*/
@isurfer21
isurfer21 / app-cli.js
Created June 27, 2021 03:24
Simplest CLI based node.js app with in-built argument parser without any dependencies
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);
@isurfer21
isurfer21 / tabulator.js
Created October 31, 2021 17:21
Tabulate the array of objects to render as HTML table
class Tabulator {
constructor(container) {
this.container = $(container);
}
setColumnHeader(columns) {
this.columns = columns;
}
toTable(data) {