Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
import os
from pathlib import Path
def create_project_structure():
# Define project structure
project_structure = [
'bin',
'classes',
@derekpappas
derekpappas / create_python_prj_structure.py
Created December 18, 2023 11:07
Create a project directory structure inside of an existing directory (perhaps a GitHub repo that has already been created
import os
from pathlib import Path
def create_project_structure():
# Define project structure
project_structure = [
'classes',
'json',
'jobs',
'resources',
import os
from pathlib import Path
def create_project_structure():
# Define project structure
project_structure = [
'classes',
'json',
'jobs',
'resources',
@derekpappas
derekpappas / checksha256sum.py
Created January 8, 2023 20:41
Check the computed sha256sum of a file against the expected sha256sum
#!/usr/bin/env python3
import subprocess
import sys
# take in a file name and a sha256 checksum
# compute the sha256 checksum of the file using a sys call
# compare the computed and expected checksums
# if they match, print "Checksums Match"
@derekpappas
derekpappas / gitAddCommitPush.py
Created December 24, 2022 14:52
Git script to make new branches
#!/usr/bin/env python3
# Most of the code in this script was generated with Github copilot
# I had to debug/fix some things...
# This script adds, commits and pushes all changes to the git repository
# It is intended to be used as a git hook, but can also be used as a standalone script
# 1. Check that the script is called from a git repository
# 2. Check that the current branch is not master or develop
# 3. Check that the current branch is not behind develop
# 4. Check that the current branch is not ahead of develop
alias git_set_upstream='git branch --set-upstream-to=origin/$(git rev-parse --abbrev-ref HEAD)'
alias gco='git checkout'
alias gci='commit'
alias gst='status'
alias gbr='branch'
alias ghist='log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short'
alias gtype='cat-file -t'
alias gdump='cat-file -p'
alias ga='git add'
alias gb='git branch'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set up the global keys
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key [f1 ] 'indent-region ) ;; search-forward-regexp
(global-set-key [f2 ] 'undo )
(global-set-key [f3 ] 'call-last-kbd-macro )
(global-set-key [f4 ] 'start-kbd-macro )
(global-set-key [f5 ] 'end-kbd-macro )
(global-set-key [f6 ] 'clear-rectangle )
#!/bin/bash
# Prevents force-pushing to master
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into the root of your repo at `.git/hooks/pre-push`
brew install inetutils
brew install classicftp
brew install gpg asdf autoconf wxmac openssl@1.1 fop coreutils automake libyaml readline libxslt libtool unixodbc unzip curl
brew install icu4c boost folly graphviz harfbuzz librsvg pango watchman node
brew link openssl@1.1 --force
asdf plugin add erlang
export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix openssl@1.1)"
asdf install erlang 24.1
asdf global erlang 24.1