Skip to content

Instantly share code, notes, and snippets.

🕵
Investigating a better artifact workflow

Jake Morrison techthoughts2

🕵
Investigating a better artifact workflow
Block or report user

Report or block techthoughts2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@techthoughts2
techthoughts2 / console_color
Created Nov 12, 2019
Change the color of the console output
View console_color
$Host.PrivateData
$host.PrivateData.ErrorForegroundColor = [System.ConsoleColor]::Magenta
View mdh_multiline_examples
<#
(## EXAMPLE [^`]*)(```\r\n)([^`]*)(```\r\n)(\r\n)([^#]*)(\r\n\r\n)+([^#]+)(#)
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n)
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n)([^#]+)(#)
#>
New-MarkdownHelp -Module MyModuleToDocument -OutputFolder $OutputDir -Force
$OutputDir | Get-ChildItem -File | ForEach-Object {
# fix formatting in multiline examples
View bom_adjust
$content = Get-Content 'Get-TelegramStickerPackInfo.Tests.ps1'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $true
$path = [System.Environment]::CurrentDirectory = (Get-Location).Path
$MyPath = "$path\Get-TelegramStickerPackInfo.Tests.ps1"
[System.IO.File]::WriteAllLines($MyPath, $content, $Utf8NoBomEncoding)
$content = Get-Content 'Send-TelegramSticker.Tests.ps1'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $true
$path = [System.Environment]::CurrentDirectory = (Get-Location).Path
@techthoughts2
techthoughts2 / vscode_basic_powershell_settings.json5
Last active Jul 21, 2019
Basic VSCode settings for PowerShell development
View vscode_basic_powershell_settings.json5
{
// editor
"editor.quickSuggestionsDelay": 1,
"editor.tabCompletion": "on",
"files.defaultLanguage": "powershell",
// default shell
// Windows
// PowerShell 6
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
View install_chrome
$P = $env:TEMP + '\chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $P; Start-Process -FilePath $P -Args '/silent /install' -Verb RunAs -Wait; Remove-Item $P
View fill_hard_drive.ps1
[io.file]::Create("$env:temp\reallybigfile-deleteme.txt").SetLength((gwmi Win32_LogicalDisk -Filter "DeviceID='C:'").FreeSpace - 1KB).Close
View c_sharp_basics
// This is a comment
/*
This is a section of comments
*/
Console.Read(); //this is an inline comment
int aNumber = 0; //declare value type variable
//casting
float num1 = 20.9;
View ps_module_update_check
Get-InstalledModule | Select-Object Name, @{n='Installed';e={$_.Version}}, @{n='Available';e={(Find-Module -Name $_.Name).Version}} | Where-Object {$_.Available -gt $_.Installed}
@techthoughts2
techthoughts2 / route53.yml
Created Mar 22, 2019
Creates an Amazon Route 53 hosted zone
View route53.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an Amazon Route 53 hosted zone
Parameters:
DomainName:
Type: String
Description: The DNS name of an Amazon Route 53 hosted zone e.g. jevsejev.io
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-)
ConstraintDescription: must be a valid DNS zone name.
Resources:
DNS:
@techthoughts2
techthoughts2 / S3Site.yml
Created Mar 22, 2019
Creates an S3 bucket configured for hosting a static website, and a Route 53 DNS record pointing to the bucket
View S3Site.yml
AWSTemplateFormatVersion: '2010-09-09'
Description: Creates an S3 bucket configured for hosting a static website, and a Route
53 DNS record pointing to the bucket
Parameters:
DomainName:
Type: String
Description: The DNS name of an existing Amazon Route 53 hosted zone e.g. jevsejev.io
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-)
ConstraintDescription: must be a valid DNS zone name.
FullDomainName:
You can’t perform that action at this time.