Skip to content

Instantly share code, notes, and snippets.

View kpatnayakuni's full-sized avatar
🏠
Working from home

Kiran Patnayakuni kpatnayakuni

🏠
Working from home
View GitHub Profile
#requires -version 7.2
using namespace system.collections.generic
using namespace system.reflection
function record {
param (
[Parameter(Mandatory)][String]$Name,
[Parameter(Mandatory)][hashtable]$Properties,
[switch]$ReadOnly
)
@asaah18
asaah18 / python guide.md
Last active November 5, 2022 16:20
a python guide/cheat-sheet intended to those who already know python and want a mind refresh or looking for a specific syntax

Python Guide

This python guide is intended to those who already know python and want a mind refresh or looking for a specific syntax.
-as this guide doesn't elaborate in explaining thing that a programmer would already know -like: variable, function, csv, json-

additionally, this guide is not intended to be a replacement for reading official Python documentation.

guide version: 2.1.0 | python version: 3.10

| Part of Version | Explanation |

{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
$parameters = @{
Key = 'F7'
BriefDescription = 'ShowMatchingHistoryOcgv'
LongDescription = 'Show Matching History using Out-ConsoleGridView'
ScriptBlock = {
param($key, $arg) # The arguments are ignored in this example
$line = $null
$cursor = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
$history = [Microsoft.PowerShell.PSConsoleReadLine]::GetHistoryItems().CommandLine | Select-Object -Unique
#region UX config
Import-Module posh-git
if (Get-Module PSReadLine) {
Import-Module oh-my-posh
$ThemeSettings.MyThemesLocation = "~/.config/powershell/oh-my-posh/Themes"
if (Get-Theme | Where-Object Name -eq Sorin-NL) {
Set-Theme Sorin-NL
@SQLDBAWithABeard
SQLDBAWithABeard / prompt.ps1
Last active March 21, 2024 07:16
new improved colourful prompt
######## POSH-GIT
# with props to https://bradwilson.io/blog/prompt/powershell
#
#
# Now for this to work most beautifully - you will need to have the latest posh-git module
#
# You will also need the MesloLGM Nerd Font Mono font
# from here https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/Meslo/M/Regular/complete/Meslo%20LG%20M%20Regular%20Nerd%20Font%20Complete.ttf
# if you are super nerdy
# or