Skip to content

Instantly share code, notes, and snippets.

View mwallner's full-sized avatar
🧙

Manfred Wallner mwallner

🧙
View GitHub Profile
@giannissc
giannissc / xilem-architecture-overview.md
Last active April 23, 2024 06:15
Xilem Architecture Overview

There are four user levels to using a GUI framework:

  1. View composition
  2. Custom interactions
  3. Custom widgets
  4. Framework Development

xilem-architecture-overview

View composition

xilem-architecture-view-composition

@ctmcisco
ctmcisco / 2021-boxstarter-package.ps1
Last active August 19, 2023 17:19
2021 Boxstarter Package
<#
.SYNOPSIS
BoxStarter script to configure Windows 10 development PC.
.DESCRIPTION
You might need to set:
Set-ExecutionPolicy RemoteSigned
Set-ExecutionPolicy Unrestricted
Set-ExecutionPolicy Bypass
@AdmiringWorm
AdmiringWorm / Funcs.md
Last active March 20, 2021 14:19
PowerShell function not to use in Chocolatey community packages

There are some rules regarding which functions can be used in in Chocolatey packages hosted on the community repository. Basically, any function not available in PowerShell v2.0 can not be used (without a fallback helper). In this gist I want to keep a list of functions that were not available in PowerShell 2.0, or I have found that did not work as expected.

  • Convert-FromJson - while it is a common function nowadays, this was only added in PowerShell 3.0 and can not be used in a community package.
  • Get-ItemPropertyValue - added in PowerShell 5.0, and do not exist on the Chocolatey verifier.
  • Import-Certificate - Only available on some Server platforms (and Windows 10). As an alternative the linked fallback helper can be used instead
@aleixmorgadas
aleixmorgadas / keychron K3.md
Last active January 6, 2023 12:36
Keychron K3 Linux
@bilbothebaggins
bilbothebaggins / ConvertTo-ArgvQuoteForPoSh.ps1
Last active May 7, 2023 16:25
Powershell V5 (and C# Code) to allow escaping native command arguments
function Get-NeedsArgvQuote {
<#
.DESCRIPTION Fix up our argument string for the insane CommandLineToArgvW rules
.LINK https://docs.microsoft.com/en-us/archive/blogs/twistylittlepassagesallalike/everyone-quotes-command-line-arguments-the-wrong-way
#>
[CmdletBinding()]
param(
[Parameter(Position=0,Mandatory=1)][AllowEmptyString()][string]$arg
)
if ([System.String]::IsNullOrEmpty($arg)) {
@nohwnd
nohwnd / restore-environment.ps1
Created July 5, 2019 08:45
Automatically clean up changes in env variables after test
# this snippet describes how to automatically clean up
# changes in environment varables
# it can clean up re-writing, adding and removing
# scroll down to see how to use it in real test
Get-Module Pester | Remove-Module
Import-Module Pester -MaximumVersion 4.9.9
function Get-Environment {
$vars = Get-Item Env:\
@AdmiringWorm
AdmiringWorm / maintainers.md
Last active September 17, 2020 12:44
@pauby's cheat sheet for what a maintainer can do 👅

What can you do as a maintainer?

The goal of this gist is to provide some details on what you can do and can't do on chocolatey.org when you are a maintainer.

  • You can not remove yourself as a maintainer for packages available on chocolatey.org. You will need to contact the site admins to be removed from a package. You will not be removed as a maintainer if you are the only maintainer listed.
  • When a new package have been pushed to chocolatey.org, a new version of the same package can not be pushed until the existing version is either approved or rejected. If the package is failing, the recommended solution is to update the existing version which fixes the failure reason. When this isn't possible, you can rejected a failing version yourself, or ask a Moderator to rejected it.
function Get-AuthorizationHeader
{
[cmdletbinding()]
Param(
[Parameter(
ValueFromPipeline)]
[PSCredential]
$Credential
)
@ian-noble
ian-noble / boxstarter-full-win10.ps1
Last active October 23, 2022 16:31
Boxstarter - Full - Windows 10
<#
.SYNOPSIS
BoxStarter script to configure Windows 10 development PC.
.DESCRIPTION
Install BoxStarter:
. { Invoke-WebRequest -useb http://boxstarter.org/bootstrapper.ps1 } | Invoke-Expression; get-boxstarter -Force
Run by calling the following from an **elevated** command-prompt.
Remove -DisableReboots parameter to allow the script to reboot as required.
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.