Skip to content

Instantly share code, notes, and snippets.

View potatoqualitee's full-sized avatar
big permz energy

Chrissy LeMaire potatoqualitee

big permz energy
View GitHub Profile
@potatoqualitee
potatoqualitee / winterm.json
Created September 22, 2022 11:13
winterm.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@potatoqualitee
potatoqualitee / lowerright.ps1
Last active September 12, 2022 10:52
PowerShell WPF popup in lower right corner of the screen
[xml]$xaml = '<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False"
Height="0" Width="0" Background="Transparent">
<Popup Name="popup" Placement="AbsolutePoint" StaysOpen="False">
<Grid Name="grid" Height="400" Width="390" Background="DarkGray">
<Label Name="label" Content="Double-click to close" Foreground="White" FontSize="18"/>
</Grid>
</Popup>
@potatoqualitee
potatoqualitee / Invoke-Program.ps1
Created September 7, 2022 12:59
Invoke-Program
function Invoke-Program {
[CmdletBinding()]
[OutputType([System.Management.Automation.PSObject])]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$FilePath,
[Parameter()]
@potatoqualitee
potatoqualitee / download-file.js
Created September 3, 2022 01:43
download-file.js
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: true, downloadsPath: '' });
const page = await browser.newPage({ acceptDownloads: true });
await page.goto('https://windowsterminalthemes.dev/');
const [download] = await Promise.all([
page.waitForEvent('download'),
@potatoqualitee
potatoqualitee / colors.ps1
Created September 1, 2022 19:08
colors.ps1
function Get-Rgb {
[cmdletbinding()]
param(
[string[]]$Color
)
# Clean up
if ($first = $Color[1]) {
$cleanedcolor = $Color -join ","
if ($first -notmatch "rgb" -and $first -notmatch "\(") {
@potatoqualitee
potatoqualitee / whatever.yml
Created August 27, 2022 16:42
doesnt work
on: push
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres_password
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
DATABASE_URL: postgres://postgres:postgres_password@localhost:5432/postgres
jobs:
process-json:
runs-on: ubuntu-latest
@potatoqualitee
potatoqualitee / action.yml
Last active August 27, 2022 01:15
Download file using Playwright in GitHub Actions
on: push
jobs:
download-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
@potatoqualitee
potatoqualitee / overview.ps1
Created August 26, 2022 09:08
dbatools presentation scripts
<#
Combo commands that are powerful and fun
1. Encrypting
2. Testing your backups
3. Disaster Recovery
#>
# Show SSMS
@potatoqualitee
potatoqualitee / Test-DarkColor.ps1
Last active August 26, 2022 04:14
Test-DarkColor
function Test-DarkColor {
<#
.SYNOPSIS
Tests an rgb or hex value to see if it's considered light or dark
.PARAMETER Color
The color to test in Hex or RGB
.NOTES
Thanks to:
@potatoqualitee
potatoqualitee / fb.ps1
Last active August 4, 2022 14:35
login to facebook mobile using powershell
$url = "https://m.facebook.com/login.php"
$webrequest = Invoke-WebRequest -Uri $url -SessionVariable session
# The cookies aren't always set properly. Here, we'll force set them
$setcookies = $webrequest.Headers["Set-Cookie"].Split(";").Trim()
foreach ($setcookie in $setcookies) {
$cookie = New-Object System.Net.Cookie
$cookie.Name = $setcookie.split("=")[0]
$cookie.Value = $setcookie.split("=")[1]
$cookie.Domain = ".facebook.com"