Skip to content

Instantly share code, notes, and snippets.

@ddpruitt
ddpruitt / docker-compose.yaml
Created June 28, 2024 00:42 — forked from dbafromthecold/docker-compose.yaml
Spinning SQL Server 2019 up with docker-compose
version: '3.7'
services:
sqlserver1:
build:
context: .
dockerfile: dockerfile
ports:
- "15789:1433"
env_file:
@ddpruitt
ddpruitt / line_follower.py
Created February 29, 2024 02:58 — forked from CS2098/line_follower.py
A LEGO Mindstorms ev3 line follower program in Python
# line_follower.py
# by: Carl Strömberg
# Import the EV3-robot library
import ev3dev.ev3 as ev3
from time import sleep
class LineFollower:
# Constructor
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@ddpruitt
ddpruitt / transform-xml.ps1
Created January 17, 2024 20:02 — forked from sayedihashimi/transform-xml.ps1
Script which can be used to transform an XML file using XDT. All you need to do is download the script and call it. The script will download the files it needs to run.
#!/usr/bin/env powershell
<#
.SYNOPSIS
You can use this script to easly transform any XML file using XDT.
To use this script you can just save it locally and execute it. The script
will download its dependencies automatically.
Created by sayediHashimi
Modified by obscurerichard
Thanks Stack Overflow: https://stackoverflow.com/questions/8989737/web-config-transforms-outside-of-microsoft-msbuild
class Package
{
[String]$id
[String]$version
[String]$targetFramework
[String]$path
}
function GatherPackageInfo([string]$path) {
$packages = @()
@ddpruitt
ddpruitt / docker-pull-images.ps1
Created October 17, 2023 12:41 — forked from DanielTheCoder/docker-pull-images.ps1
Docker update all images using PowerShell
# Pull all images based on https://gist.github.com/gte445e/85119eb6e93bd46fb2bbd3e3a362ce68
docker images --format "{{.Repository}}" | Where-Object {$_ -ne "<none>"} | %{Write-Host "Pulling image: $_ ..."; docker pull $_}
@ddpruitt
ddpruitt / Find-GitRepository.ps1
Created August 16, 2023 15:12 — forked from jdhitsolutions/Find-GitRepository.ps1
Use this PowerShell function to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
Function Find-GitRepository {
<#
.SYNOPSIS
Find Git repositories
.DESCRIPTION
Use this command to find Git repositories in the specified folder. It is assumed that you have the Git command line tools already installed.
.PARAMETER Path
The top level path to search.
@ddpruitt
ddpruitt / Ancient Greek Geometry.md
Created June 15, 2022 20:29 — forked from mrflip/Ancient Greek Geometry.md
Ancient Greek Geometry walkthrough / answers / cheats
@ddpruitt
ddpruitt / jwtRS256.sh
Last active May 11, 2022 19:36 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
#
# From "How to generate a JWT RS256 key" Gist <https://gist.github.com/ygotthilf/baa58da5c3dd1f69fae9>
#
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# NOTE: Don't add a passphrase when prompted:
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
#
# On Windows use the openssl.exe in the git usr\bin folder.
@ddpruitt
ddpruitt / ConvertFrom-Xml.ps1
Created January 20, 2021 16:44 — forked from elvarb/ConvertFrom-Xml.ps1
Powershell to convert XML to JSON
# From https://stackoverflow.com/questions/42636510/convert-multiple-xmls-to-json-list
# Use
# [xml]$var = Get-Content file.xml
# Convert to JSON with
# $var | ConvertFrom-XML | ConvertTo-JSON -Depth 3
# Helper function that converts a *simple* XML document to a nested hashtable
# with ordered keys.
function ConvertFrom-Xml {
param([parameter(Mandatory, ValueFromPipeline)] [System.Xml.XmlNode] $node)