Skip to content

Instantly share code, notes, and snippets.

View ajwitchger's full-sized avatar

Andrew Witchger ajwitchger

  • OppFi
  • Durham
View GitHub Profile
@ajwitchger
ajwitchger / swagger-json-to-html.py
Last active May 4, 2023 14:11
[Swagger JSON to HTML] Converts Swagger JSON to a static HTML document
#!/usr/bin/python
#
# This file is based on
# https://gist.github.com/oseiskar/dbd51a3727fc96dcf5ed189fca491fb3
# (Copyright 2017 Otto Seiskari, Licensed under the Apache License, Version 2.0.)
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
"""
Usage:
@ajwitchger
ajwitchger / clean_idea_folder_from_repo.md
Created March 24, 2022 14:57
[Remove .idea folder from repo and add to gitignore] Fix accidental commit of the .idea folder from project #git

Steps

  1. echo '.idea' >> .gitignore add folder to gitignore
  2. git rm .idea/ -r --cached remove folder from local git cache
  3. git add .gitignore commit .gitignore update
  4. git commit -m '(added .idea folder to ignored entries)'
  5. git add -u .idea/ commit .idea folder update
  6. git commit -m "Removed the .idea folder"
  7. git push push changes to repo
@ajwitchger
ajwitchger / reset-docker.ps1
Last active March 15, 2022 18:08
[Nuclear purge for docker] #windows #docker #mac #linux
# Force script to run as admin
function Test-Admin {
param([switch]$Elevated)
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
if ((Test-Admin) -eq $false) {
if ( ! $elevated) {
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-ExecutionPolicy Bypass -noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
@ajwitchger
ajwitchger / docker_stop_and_rm.md
Last active February 28, 2022 19:05
[Docker stop and remove cheat sheet] #shell #docker #docker-compose

Stop containers

Stop specific containers, gracefully

docker container stop <container_name> <container_name>

Kill all, force stop

docker kill $(docker ps -q)

Stop all, gracefully

@ajwitchger
ajwitchger / git_fetch_pull_all_subfolders.sh
Last active April 5, 2021 18:07 — forked from mnem/git_fetch_pull_all_subfolders.sh
Simple bash script for fetching and pulling all repos in the executed folder to the latest of the branch they are on
#!/bin/bash
################
# Uncomment if you want the script to always use the scripts
# directory as the folder to look through
REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#REPOSITORIES=`pwd`
IFS=$'\n'
@ajwitchger
ajwitchger / AdjustFrontWindow.scpt
Created March 9, 2021 20:04
Resize Window For Screen Sharing - AppleScript
(*
This script resizes the front-most window to a preset dimension for an easy
and consistent (single-window) screen sharing experience on video calls.
Andrew Witchger Mar 2021
Setup:
1. Open in Script Editor, and go to File -> Export...
2. Change File Format to "Application" and Save
@ajwitchger
ajwitchger / reclaimWindows10.ps1
Created April 13, 2018 13:59 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.12.1, 2018-03-15
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...