Skip to content

Instantly share code, notes, and snippets.

View paull10au's full-sized avatar
🎯
Focusing

paull10au

🎯
Focusing
View GitHub Profile
@paull10au
paull10au / deep-clone.js
Created January 2, 2020 03:51
Returns a deep copy of the array or object passed to it.
/**
* 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.
@paull10au
paull10au / Generate Random UUIDs - LICENSE.txt
Last active November 15, 2018 01:06 — forked from jed/LICENSE.txt
Generate Random UUIDs
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
@paull10au
paull10au / index.js
Created November 2, 2018 11:48 — forked from ruucm-working/index.js
npx is cool
#!/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)
}
@paull10au
paull10au / index.js
Last active November 2, 2018 11:31
Retry with exponential backoff
#!/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()
@paull10au
paull10au / index.js
Last active November 2, 2018 01:39 — forked from zkat/index.js
npx is cool
#!/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() {