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
/** | |
* Returns a deep copy of the array or object passed to it. | |
* Useful for copying objects and arrays with nested complex types. | |
* | |
* @param {array|object} o The value to deep copy, could be array or object. | |
* @returns {array|object} Returns a deep copy of the supplied array or object. | |
*/ | |
function deepClone(o) { | |
// Construct the copy `output` array or object. | |
// Use `Array.isArray()` to check if `o` is an array. |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 node | |
console.log('yay gist~') | |
var shell = require('shelljs') | |
var readlineSync = require('readline-sync') | |
if (!shell.which('git')) { | |
shell.echo('Sorry, this script requires git') | |
shell.exit(1) | |
} |
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 node | |
//const util = require('util'); | |
const http = require('http'); | |
const happyb = require('happy-birthday'); | |
//const request = require('request'); | |
//const home = process.env.HOME; | |
//console.log() |
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 node | |
const { version, name } = require('./package.json'); | |
const util = require('util'); | |
const exec = util.promisify(require('child_process').exec); | |
console.log(version, name); | |
console.log(process.cwd()); | |
console.log(__dirname); | |
async function systemVersionInfos() { |