Skip to content

Instantly share code, notes, and snippets.

View gep13's full-sized avatar

Gary Ewan Park gep13

View GitHub Profile
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace Ghostly.Utilities
{
// Emoji list borrowed from https://github.com/lunet-io/markdig/blob/25959174d521c7f4458fa7b340d58a4ac136fa30/src/Markdig/Extensions/Emoji/EmojiParser.cs
public static class EmojiReplacer
{
private static Regex _regex;
private static Dictionary<string, string> _lookup;
@adamralph
adamralph / ci.md
Last active September 9, 2019 21:58
My current assessment of SaaS CI systems

This assessment is performed with respect to the requirements of the .NET community open source projects which I maintain. It is restricted to the free tier provided by each system.

Only the drawbacks are listed, which makes the assessment sound a bit negative, but it's relative to a baseline functional expectation:

  • Linux and Windows
  • Fast provisioning
  • Concurrent builds
  • Common build properties surfaced as env vars (e.g build number)
  • Readable, copyable, and line-linkable log output, supporting ANSI colour codes and code page 437
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
@pitermarx
pitermarx / build.ps1
Last active December 9, 2019 11:57
Cake task autocomplete in powershell
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Normal",
[Parameter(Position = 0, Mandatory = $false, ValueFromRemainingArguments = $true)]
[string[]]$ScriptArgs
)
dynamicparam {
@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.
@patriksvensson
patriksvensson / Register.ps1
Created October 10, 2018 22:57
Argument completer for Spectre.Cli
Register-ArgumentCompleter -Native -CommandName myapp -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
$split = $wordToComplete.ToString().Split()
$command = [system.String]::Join("_", $split[1..$split.Length])
$position = ($cursorPosition-$split[0].Length - 1);
myapp complete --position $position "$command" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
@analogrelay
analogrelay / CommandLineException.cs
Last active March 22, 2024 11:50
My Command Line Template
using System;
using System.Runtime.Serialization;
namespace MyTool
{
[Serializable]
internal class CommandLineException : Exception
{
public CommandLineException()
{
@StefanScherer
StefanScherer / Vagrantfile
Created June 25, 2018 05:32
Turn on auto logon in a sysprepped Vagrant box
Vagrant.configure("2") do |config|
config.vm.define "tst" do |cfg|
cfg.vm.box = "StefanScherer/windows_2016"
cfg.vm.hostname = "tst"
cfg.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
vb.linked_clone = true
end
@punker76
punker76 / App.config
Last active April 6, 2018 13:45
Show SVG at MahApps IconTemplate with SkiaSharp.Svg
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="SkiaSharp" publicKeyToken="0738eb9f132ed756" culture="neutral" />
function ConvertTo-ChocoPackage {
<#
.SYNOPSIS
Convert a PowerShell module into a chocolatey package.
.DESCRIPTION
Convert a PowerShell module into a chocolatey package.
.EXAMPLE
Find-Module pester | ConvertTo-ChocoPackage
Find the module pester on a PS repository and convert the module to a chocolatey package.