Easy tool to split the current $PATH of the system into individual lines.
#!/bin/bash
{
for i in $(echo "$PATH" | sed 's/:/ /g'); do echo $i; done;
#!/usr/bin/env node | |
console.log("I ranz from GitHub Gist."); | |
console.table(["01011001b 01000001b 01000001b 01000001b 01000001b 01011001b 01011001b 01011001b 01011001b 01011001b 01011001b 01011001b 01011001"]); |
/** | |
* @param {number[]} nums | |
* @param {number} k | |
* @return {number[]} | |
*/ | |
const maxSlidingWindow = function(nums, k) { | |
if (k == 0) return Array(0); | |
const iterateNumbers = (nums, filterSize) => { | |
const len = nums.length; | |
const max = []; |
/** | |
* double-numbers.js | |
* | |
* Translates an Array of Numbers to Double that using Recursion and some ES6 tricks. | |
* @some(techniques).included([expansion assignment, rest operator, spread operator, ternary operator, arrow functions]) | |
*/ | |
((numbers=[]) => { | |
const doubleNumbers = ( collection = [], [ head, ...tail ] = collection ) => | |
(collection.length === 0) |
{ | |
let elementA = { | |
name: 'xyz', | |
children: [ | |
{ name: 'abc' }, // firstChild | |
{ name: 'bcd'} // secondChild | |
] | |
}; | |
const getFirst = (d = []) => ([f, ...r] = d, f); | |
const firstChild = getFirst(elementA.children); |
// https://news.ycombinator.com/item?id=20867123 | |
// "Ask HN: Who is hiring? (September 2019)" | |
((context, skills=[]) => { | |
// findRemote, filter the list to only show remote positions | |
const findRemote = testText => | |
testText.search(new RegExp(/remote/ig)) > -1 | |
? true | |
: false; |
/** | |
* Using counting sort algorithm | |
* | |
* Take an Array from: | |
* [1, 4, 1, 2, 7, 5, 2] | |
* to | |
* [1, 1, 2, 2, 4, 5, 7] | |
*/ | |
((Arr) => { | |
// Arr: Unsorted - Zero-based Indicies Array |
High-Order Function, as a structural transformation, the fold is a polymorphic function.
This just means, it takes on different forms (poly = multiple), and can take data from one element and transform it into another.
Specifically, this is speaking to the 'left fold'.
/** | |
* Given a singly-linked-list, determine if there is a cycle. | |
*/ | |
(() => { | |
// Predefine Global Structure & helper function | |
class LinkedListNode { | |
constructor(value) { | |
this.value = value; | |
this.next = null; |