Skip to content

Instantly share code, notes, and snippets.

View josh-hemphill's full-sized avatar

Josh josh-hemphill

View GitHub Profile
@josh-hemphill
josh-hemphill / toAnchor.js
Last active March 4, 2021 17:52
Create GitHub/GitLab anchor link from header text
function toAnchor(...text) {
let temp = text.join('').toLowerCase();
temp = temp.replace(/[^\w ]+/g,'');
temp = temp.replace(/ +/g,'-');
return '#' + temp;
}
const t = toAnchor;
#!/bin/bash
read -p "Install LF for Ubuntu20.04? [Y/n]" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Nn]$ ]]
then
echo 'deb http://download.opensuse.org/repositories/home:/Provessor/xUbuntu_20.04/' | sudo tee /etc/apt/sources.list.d/home:Provessor.list
wget -q -nv -O - https://download.opensuse.org/repositories/home:Provessor/xUbuntu_20.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_Provessor.gpg > /dev/null
sudo apt update
sudo apt install lf
fi
@josh-hemphill
josh-hemphill / npmSec
Created October 9, 2020 17:20
NPM Security totals by depth0 package
#!/usr/bin/env node
'use strict';
const {execSync} = require('child_process');
let result = {};
try {
result = execSync(`npm audit --json --long`);
} catch (error) {
const {stdout, stderr} = error;
result = {stdout, stderr};
}
@josh-hemphill
josh-hemphill / npmUpgrade
Created October 9, 2020 17:19
npmUpgrade
#!/usr/bin/env node
'use strict';
const {execSync} = require('child_process');
let result = {};
try {
result = execSync(`npm outdated --json --long`);
} catch (error) {
const {stdout, stderr} = error;
result = {stdout, stderr};
}