This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source: https://communities.vmware.com/thread/573025 (I basically just modified for Catalina) | |
hdiutil create -o Catalina -size 10G -layout SPUD -fs HFS+J -type SPARSE | |
hdiutil attach Catalina.sparseimage -noverify -mountpoint /Volumes/install_build | |
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build | |
hdiutil detach "/Volumes/Install macOS Catalina" | |
hdiutil convert Catalina.sparseimage -format UDZO -o Catalina.dmg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tput colors | |
for i in {0..255} ; do | |
printf "\x1b[38;5;${i}m${i} " | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://twitter.com/DCoderLT/status/996049864495648768 | |
cd $(mktemp -d) # get an instant temporary directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -e | |
# download disk image | |
cd ~/Downloads | |
curl -O https://download.docker.com/mac/stable/Docker.dmg | |
# attach disk image | |
hdiutil attach Docker.dmg | |
# copy app folder to Applications directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const toLower = (char) => { | |
const code = char.charCodeAt(0) | |
return String.fromCharCode(code > 64 && code < 91 ? code | 0b100000 : code) | |
} | |
const toUpper = (char) => { | |
const code = char.charCodeAt(0) | |
return String.fromCharCode(code > 96 && code < 123 ? code ^ 0b100000 : code) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase --onto master head~4 # or how every many commits you need |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const msd = n => Math.floor(n / Math.pow(10, Math.floor(Math.log10(n)))) | |
const accumulator = (histogram, value) => (histogram[value - 1]++, histogram) | |
const scale = (num, idx, arr) => num / arr.reduce((count, val) => count + val, 0) | |
const benford = list => list | |
.map(msd) | |
.reduce(accumulator, Array(9).fill(0)) | |
.map(scale) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const msd = n => Math.floor(n / 10 ** Math.floor(Math.log10(n))) | |
const accumulator = (histogram, value) => (histogram[value - 1]++, histogram) | |
const scale = (num, idx, arr) => num / arr.reduce((count, val) => count + val, 0) | |
const benford = list => list | |
.filter(Boolean) | |
.map(Math.abs) | |
.map(msd) | |
.reduce(accumulator, Array(9).fill(0)) | |
.map(scale) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inoremap jj <ESC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let (|Both|Three|Five|Neither|) n = | |
if n % 15 = 0 then Both | |
elif n % 3 = 0 then Three | |
elif n % 5 = 0 then Five | |
else Neither | |
let fizzbuzz n = | |
match n with | |
| Both -> "FizzBuzz" | |
| Three -> "Fizz" |
NewerOlder