Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am jessebutryn on github.
  • I am jesse_b (https://keybase.io/jesse_b) on keybase.
  • I have a public key ASD8eQm6Fjti9hTaJ2kplCrnjBTM2za8MxOGnlDfBGwvcwo

To claim this, I am signing this object:

View yt-convert.sh
#!/usr/bin/env bash
#set -x
trap ctrl_c INT
ctrl_c () {
rm -r "$_tmpdir"
exit 2
}
@jessebutryn
jessebutryn / mkdirs.ps1
Created Aug 19, 2020
powershell script to make directories for each file in a directory and move those files into them.
View mkdirs.ps1
# This script will make directories for all files in a specified directory and move them into it.
# You must provide the input directory as the first argument and can optionally specify an output
# directory as the second argument. If no output directory is specified the input directory will
# be used.
$inDir = $args[0]
$outDir = $args[1]
$isInDir = Test-Path -LiteralPath $inDir -PathType Container
@jessebutryn
jessebutryn / bup.ps1
Created Aug 18, 2020
file backup script
View bup.ps1
$sdirs = @(
"C:\Users\jesse_b"
#"C:\Users\jesse_b\tmp"
)
$ddir = "Y:\jesse"
#$ddir = "C:\Users\jesse_b\tmp\test"
function fsync ($source,$target) {
View prime.c
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int n, x, i, s, f, l;
if ( argc < 2 ) {
printf("oi! Provide an argument!\n");
return 1;
@jessebutryn
jessebutryn / morse.sh
Created Dec 26, 2019
bash script to convert text to morse code
View morse.sh
#!/usr/bin/env bash
#
#set -x
#######################################
declare -A morse
morse[0]='- - - - -'
morse[1]='. - - - -'
morse[2]='. . - - -'
morse[3]='. . . - -'
morse[4]='. . . . -'
@jessebutryn
jessebutryn / Test.txt
Created Oct 26, 2019
This is only a test
View Test.txt
#!/bin/sh
# comment
func () {
for ((i=1;i<10;i++)); do
:
done
}
printf '%s\n' Foo bar baz
@jessebutryn
jessebutryn / test.txt
Last active Oct 26, 2019
testing gist api
View test.txt
#!/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 Oct 23, 2019
Trying manual epoch calculations
View reinvented_wheel.sh
#!/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 Oct 17, 2019
Calculating the character distribution of common unix commands, builtins, and keywords
View results.txt
! 1
: 1
K 1
O 1
{ 1
} 1
7 2
E 2
G 2
H 2