Skip to content

Instantly share code, notes, and snippets.

View jeremyswann's full-sized avatar
🕸️
Web3 vibes

Jeremy Swanborough jeremyswann

🕸️
Web3 vibes
View GitHub Profile
@jeremyswann
jeremyswann / filter-array.js
Last active July 31, 2019 06:04
Utility Functions
//@ts-check
/**
* *Filter Array
* Filter an array of objects by a specific key
* @param {Array} array
* @param {String} filterKey
* @returns {Promise<String>} value of object
*/
async function filterArray(array, filterKey) {
/** Array.prototype.filter() */
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1