Skip to content

Instantly share code, notes, and snippets.

View jessebutryn's full-sized avatar

Jesse_b jessebutryn

View GitHub Profile
@jessebutryn
jessebutryn / blackjack.sh
Last active September 10, 2017 13:14
Blackjack game
#! /usr/local/bin/bash -
#
TXT_BLD=$(tput bold)
TXT_YLW=$(tput setaf 3)
TXT_RED=$(tput setaf 1)
TXT_GRN=$(tput setaf 2)
TXT_WARN="${TXT_BLD}${TXT_YLW}"
TXT_ERR="${TXT_BLD}${TXT_RED}"
TXT_OKAY="${TXT_BLD}${TXT_GRN}"
TXT_RST=$(tput sgr0)
@jessebutryn
jessebutryn / convert
Created October 14, 2017 23:55
TimeZone Converter
#! /bin/bash -
#set -x
#
# Copyright (c) 2017 Joyent Inc.
#
# This script will convert times from one timezone to another.
#
# Author: Jesse Butryn <jesse.butryn@joyent.com>
#
# 10/14/2017 - Initial draft.
[root@JBCLAMP001 ~]# array+=('three')
[root@JBCLAMP001 ~]# echo ${array[@]}
zero one two three
[root@JBCLAMP001 ~]# array+='four'
[root@JBCLAMP001 ~]# echo ${array[@]}
zerofour one two three
@jessebutryn
jessebutryn / tree.pl
Last active December 27, 2017 03:49
Perl Tree
#! /usr/bin/env perl
$my_tree = '#';
$max_length = 70;
for ($i=0; $i <= 20; ++$i) {
printf "%s%-${max_length}s\n", ' ' x int(($max_length - length $my_tree)/2), $my_tree;
$my_tree = $my_tree . '##';
}
$my_trunk = substr( $my_tree, 0, 6 );
go () {
declare -A local goARR=(
[tools]='/Users/jessebutryn/Documents/scripts/shell/NOCTools'
[tmp]='/Users/jessebutryn/tmp'
[wtf]='/Users/jessebutryn/Documents/Reference/wtfisbash'
[pics]='/Users/jessebutryn/Pictures'
[scripts]='/Users/jessebutryn/Documents/scripts'
)
PS3='Select a directory: '
if [[ -z "$1" ]]; 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
#
@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
@@@@@@@@@
@@@ /@@@@ @@ @@ ,@@@
@@@ /@@@ #@@@ @@@@ @@
@ @@ @& @* @@@@ &@
@ @@ @ @@@@@@@@ @
@ @@ #@@@ .@ @@@@@@@ @
@
#!/bin/bash
multiples=()
is_mult () {
local n=$1
local m=$2
if ! (( n % m )); then
return 0
else
----------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