Skip to content

Instantly share code, notes, and snippets.

View cdhunt's full-sized avatar

Chris Hunt cdhunt

View GitHub Profile
# [CloudSmithClientPackagesGet]::new('stackoverflow','nuget').Invoke() | select Name, Version, Uploaded_At, Slug
class CloudSmithClient {
[string]$Namespace
[string]$Uri
[string]$Method
[string] hidden $ApiVersion = 'v1'
[string] hidden $Path
[hashtable] hidden $Headers = @{ }
@cdhunt
cdhunt / cdhunt.format.ps1xml
Created April 8, 2021 13:13
Combing FileSystemTypes formats from Powershell-Humanizer and Termincal-Icons
<?xml version="1.0" encoding="utf-8" ?>
<!-- Based on the format.ps1xml file from DirColors
https://github.com/DHowett/DirColors -->
<Configuration>
<SelectionSets>
<SelectionSet>
<Name>FileSystemTypes</Name>
<Types>
<TypeName>System.IO.DirectoryInfo</TypeName>
@cdhunt
cdhunt / cal.ps1
Last active October 8, 2021 13:23
Print a calendar in PowerShell
function Show-Calendar {
[CmdletBinding()]
param (
[Parameter(Position = 0)]
[int]
$Month = (Get-Date).Month,
[Parameter(Position = 1)]
[int]
$Year = (Get-Date).Year,
@cdhunt
cdhunt / Dockerfile
Last active October 4, 2021 11:23
CircleCI build image with Dotnet SDK
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y wget
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb
RUN apt-get update && apt-get install -y \
apt-transport-https \
[global]
ioengine=libaio # sync|libaio|mmap
group_reporting
thread
size=10g # Size of test file
cpus_allowed=1 # Only use this CPU core
runtime=300s # Run test for 5 minutes
[test1]
filename=/var/opt/mssql/tmp/fio-test-file
@cdhunt
cdhunt / checkout.yaml
Created September 23, 2021 12:24
Dymanic-ish GitHub Actions Workflow
jobs:
setup:
name: Setup Workflow Variables
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Generate Build matrix

Keybase proof

I hereby claim:

  • I am cdhunt on github.
  • I am chris_hunt (https://keybase.io/chris_hunt) on keybase.
  • I have a public key ASDqctqI9RLH5fhp96Ay1KndIhfhdgq2ODQ9an2I-xgXkwo

To claim this, I am signing this object:

@cdhunt
cdhunt / Shortcut Target
Last active February 8, 2021 15:46
Information Title Tab script
C:\Users\chunt\AppData\Local\Microsoft\WindowsApps\wt.exe -p "Title" ; new-tab -p "PowerShell"
@cdhunt
cdhunt / settings.json
Last active October 22, 2020 18:45
Windows Terminal Simple Info Tab
{
"guid": "{210e8de2-5833-4c64-b26f-17c59470c5ea}",
"hidden": false,
"name": "Title",
"commandline" : "C:\\Program Files\\PowerShell\\7\\pwsh.exe -c c:\\temp\\title.ps1",
"icon" : "ms-appdata:///Local/dashboard_white_36x36.png"
},
#Requires -Module Requirements
& {
@{
Describe = 'SecretManagement is installed'
Test = {
$module = Get-Module -Name Microsoft.PowerShell.SecretManagement -ListAvailable -ErrorAction SilentlyContinue
$module.Version -contains '0.2.1'
}
Set = {