Skip to content

Instantly share code, notes, and snippets.

@jessebutryn
jessebutryn / test.txt
Last active October 26, 2019 19:29
testing gist api
#!/bin/sh
# comment
func () {
for ((i=1;i<10;i++)); do
:
done
}
printf '%s\n' Foo bar baz
@jessebutryn
jessebutryn / reinvented_wheel.sh
Last active October 23, 2019 17:43
Trying manual epoch calculations
#!/usr/bin/env bash
#
#set -x
#
_date=$1
wheelv2 () {
local d=$1
local _year _month _day _hour _minute _second epoch today days_since_epoch seconds_since_epoch
local pattern='[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z'
if ! [[ "$d" =~ $pattern ]]; then
@jessebutryn
jessebutryn / results.txt
Last active October 17, 2019 20:29
Calculating the character distribution of common unix commands, builtins, and keywords
! 1
: 1
K 1
O 1
{ 1
} 1
7 2
E 2
G 2
H 2
Delivered-To: [email protected]
Received: by 2002:ab0:30cb:0:0:0:0:0 with SMTP id c11csp2567588uam;
Fri, 5 Jul 2019 10:08:37 -0700 (PDT)
X-Received: by 2002:a1c:d10c:: with SMTP id i12mr4211806wmg.152.1562346517130;
Fri, 05 Jul 2019 10:08:37 -0700 (PDT)
ARC-Seal: i=3; a=rsa-sha256; t=1562346517; cv=pass;
d=google.com; s=arc-20160816;
b=NDulo+3LZSabFv7iJ7HtpCGatX8lFtYd3bLsF9/zFGmYB0osxz3NXUlKYMjO2yKiEt
dU9f9siaIw6y0NucDrIhc3QSDDX1QZGPxKxIhc7HwtTs76ZMIEHBJcqZ/Ik7ukXDuwKR
+sQRqZwKw0j+vmNr/76N+34qtMsxSLcHYu19bN3rkeHwyYcULrI/5gHwFsIAuUd8+m3D
@jessebutryn
jessebutryn / make_prog
Created June 8, 2019 16:25
This script will create a 12 week lifting program based on your 1 rep maxes
#!/usr/bin/env bash
# VARIABLES
##################################
weeks[1]='70:5'
weeks[2]='75:3'
weeks[3]='80:1'
weeks[4]='75:5'
weeks[5]='80:3'
weeks[6]='85:1'
----------Week 1----------
squat: 284 x 5
squat: 284 x 5
squat: 284 x 5
squat: 284 x 5
squat: 284 x 5
bench: 210 x 5
bench: 210 x 5
#!/bin/bash
multiples=()
is_mult () {
local n=$1
local m=$2
if ! (( n % m )); then
return 0
else
@@@@@@@@@
@@@ /@@@@ @@ @@ ,@@@
@@@ /@@@ #@@@ @@@@ @@
@ @@ @& @* @@@@ &@
@ @@ @ @@@@@@@@ @
@ @@ #@@@ .@ @@@@@@@ @
@
@jessebutryn
jessebutryn / obfuscated.sh
Last active April 19, 2018 18:53
Hello world script
#!/bin/bash
declare -a alph
declare -a prnt
for l in {a..z}; do
alph+=( "$l" )
done
while read -r i; do
if ((i==7)); then
@jessebutryn
jessebutryn / mac-notify
Last active March 3, 2018 23:08
Mac notify script
#!/usr/bin/env bash
#set -x
#
# Copyright (c) 2018 Joyent Inc.
#
# This script will set a reminder on your mac that generates a popup notification
# using applescript upon completion.
#
# shellcheck disable=SC2155
#