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
@echo off | |
setlocal | |
set wasi_bin_path=%WASI_SDK_PATH%\bin | |
set wasi_self=%~n0 | |
set wasi_cmd=%1 | |
if "%wasi_cmd%" == "" ( | |
echo Usage: %wasi_self% executable [arguments] | |
exit /b 1 | |
) | |
if not exist "%wasi_bin_path%\%wasi_cmd%.exe" ( |
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
const fs = require("fs").promises; | |
const path = require("path"); | |
// A class to remove all comments from a js file | |
class CommentRemover { | |
// A constructor that takes a file name as an argument | |
constructor(filePath) { | |
// A property to store the file name | |
this.filePath = filePath; | |
// A property to store the file content |
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
/* | |
@title Sample minimal static server | |
@file static-server.js | |
@setup npm install connect serve-static | |
@usage node static-server.js | |
*/ | |
const os = require('os'); | |
const path = require('path'); | |
const connect = require('connect'); | |
const serveStatic = require('serve-static'); |
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 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 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 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, '""'); |
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
#!/usr/bin/env node | |
const APP_NAME = 'CliApp'; | |
const APP_VER = '1.0.0'; | |
class CliArgParser { | |
constructor() { | |
this.argv = process.argv.slice(2); | |
this.args = this.map(); | |
} |
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
class Tabulator { | |
constructor(container) { | |
this.container = $(container); | |
} | |
setColumnHeader(columns) { | |
this.columns = columns; | |
} | |
toTable(data) { |
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
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 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
/* | |
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 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
/* | |
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 | |
*/ |