Skip to content

Instantly share code, notes, and snippets.

View jpomfret's full-sized avatar

Jess Pomfret jpomfret

View GitHub Profile
@SQLDBAWithABeard
SQLDBAWithABeard / Get-MicrosoftTags.ps1
Last active May 27, 2022 15:25
get microsoft tags
function Get-MicrosoftTags {
$AllRepos = (iwr https://mcr.microsoft.com/v2/_catalog).content | ConvertFrom-Json
# $AllRepos.Repositories | where{ $_ -like '*sql*'}
if ($IsCoreCLR) {
$repo = $AllRepos.Repositories | Out-ConsoleGridView -OutputMode Single
}
else {
$repo = $AllRepos.Repositories | Out-GridView -Passthru
}
$Url = "https://mcr.microsoft.com/v2/{0}/tags/list" -f $repo
@SQLvariant
SQLvariant / Mmmm_Chocolatey.ps1
Last active September 9, 2023 12:15
Install SQL / Data Developer Desktop Tools from Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey -y
choco install sql-server-management-studio -y
choco install azure-data-studio -y
choco install azuredatastudio-powershell -y
choco install git.install -y
choco install vscode -y
choco install vscode-powershell -y
choco install powerbi -y
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@echohack
echohack / powershell_null_coalescing.ps1
Created July 20, 2015 19:00
Powershell Null Coalescing
($PhysicalPath, "c:\inetpub\wwwroot" -ne $null)[0] # null coalescing
# Based on the order of operations, this works in following order:
# The , operator creates an array of values to be tested.
# The -ne operator filters out any items from the array that match the specified value--in this case, null. The result is an array of non-null values in the same order as the array created in Step 1.
# [0] is used to select the first element of the filtered array.
# Simplifying that:
@adam-p
adam-p / Local PR test and merge.md
Last active February 5, 2024 19:39
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37