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;
{ | |
let elementA = { | |
name: 'xyz', | |
children: [ | |
{ name: 'abc' }, // firstChild | |
{ name: 'bcd'} // secondChild | |
] | |
}; | |
const getFirst = (d = []) => ([f, ...r] = d, f); | |
const firstChild = getFirst(elementA.children); |
/** | |
* 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) |
/** | |
* @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 = []; |
#!/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"]); |
clang hello-world.c
[["1990",[6,159,0.001,30,99,0.002,45,-109,0.000,42,115,0.007,4,-54,0.000,-16,-67,0.014,21,-103,0.006,-20,-64,0.004,-40,-69,0.001,32,64,0.001,28,67,0.006,8,22,0.000,-15,133,0.000,-16,20,0.000,55,42,0.006,32,-81,0.010,31,36,0.067,9,80,0.016,42,-91,0.006,19,54,0.001,21,111,0.163,-3,-51,0.001,33,119,0.150,65,21,0.002,46,49,0.015,43,77,0.043,45,130,0.018,4,119,0.006,22,59,0.002,9,-82,0.003,46,-60,0.002,-14,15,0.006,-15,-76,0.001,57,15,0.007,52,9,0.056,10,120,0.004,24,87,0.134,0,-51,0.005,-5,123,0.013,-24,-53,0.010,-28,-58,0.015,43,0,0.019,24,70,0.023,-9,33,0.012,20,73,0.037,13,104,0.034,43,41,0.012,23,78,0.095,20,-72,0.001,38,-4,0.006,0,-77,0.016,-9,-35,0.056,25,109,0.034,-13,34,0.013,61,18,0.001,58,40,0.002,34,50,0.027,49,88,0.000,48,-99,0.001,-42,176,0.002,20,86,0.156,-18,30,0.007,53,44,0.006,29,18,0.001,5,16,0.003,49,-74,0.000,48,131,0.006,14,121,0.210,63,19,0.001,40,54,0.001,36,57,0.005,16,52,0.000,50,128,0.010,39,30,0.021,54,12,0.006,16,-61,0.011,27,80,0.196,29,101,0.001,14,78,0.067,7,13,0.003,41,125,0.026,-1 |
/** | |
// using built-in functions | |
*/ | |
function findMaxStockProfit(arr1) { | |
if (arr1.length < 2) { | |
return 0; | |
} | |
let arr1Min = Math.min(...arr1); | |
let subset = arr1.slice(arr1.indexOf(arr1Min)); |
# 10 Largest Files | |
find . -type f -print0 | xargs -0 du -s | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {} |