This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": | |
[ | |
{ | |
"command": | |
{ | |
"action": "copy", | |
"singleLine": false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-Program { | |
[CmdletBinding()] | |
[OutputType([System.Management.Automation.PSObject])] | |
param | |
( | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] | |
[string]$FilePath, | |
[Parameter()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Rgb { | |
[cmdletbinding()] | |
param( | |
[string[]]$Color | |
) | |
# Clean up | |
if ($first = $Color[1]) { | |
$cleanedcolor = $Color -join "," | |
if ($first -notmatch "rgb" -and $first -notmatch "\(") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: push | |
jobs: | |
download-file: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Combo commands that are powerful and fun | |
1. Encrypting | |
2. Testing your backups | |
3. Disaster Recovery | |
#> | |
# Show SSMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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" |