Skip to content

Instantly share code, notes, and snippets.

View paulplew's full-sized avatar
⛰️

Paul Plew paulplew

⛰️
  • Boston, Massachusetts
View GitHub Profile
@paulplew
paulplew / ruby.sh
Created August 17, 2021 02:55
Ruby Shebang
# with debugging options
#!/usr/bin/ruby -w
# regular
#!/usr/bin/ruby
@paulplew
paulplew / applescript.sh
Created August 17, 2021 02:54
Applescript Shebang
#!/usr/bin/osascript
@paulplew
paulplew / options.sh
Last active April 16, 2021 02:14
Parse Options Passed to a Bash Script
#!/usr/bin/env bash
# Paste this into a file, chmod 755 it, and try it out
while :; do
case $1 in
## Use this syntax to add an option
-o|--otheroption)
printf '%s \n' "I'm option $1"
@paulplew
paulplew / decimal-to-hex.js
Last active August 27, 2021 22:02
Convert Decimal to Hexadecimal in Javascript
// The simple way
const hex = (number) => number.toString(16)
console.assert(hex(15) === 'f')
console.assert(hex(-30) === '-1e')
console.assert(hex(100) === '64')
### Keybase proof
I hereby claim:
* I am paulplew on github.
* I am plewp (https://keybase.io/plewp) on keybase.
* I have a public key whose fingerprint is FA91 E146 2F0E 8E6F 29F1 BEFB D4FE 44E0 D4AE 6B8D
To claim this, I am signing this object: