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
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[string] | |
$InputFile | |
) | |
function Get-Participants ($file) { | |
$allLines = Get-Content -Path $InputFile |
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
<# | |
.SYNOPSIS | |
Sets pointer size | |
.DESCRIPTION | |
Can be used with e.g. desktop shortcuts to have a one-click solution | |
powershell.exe -NoLogo -ExecutionPolicy Bypass -Command ".\Set-PointerSize.ps1 -Size 5" | |
.EXAMPLE | |
./Set-PointerSize.ps1 -Size 3 | |
Sets the cursor size to 3 | |
.EXAMPLE |
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
sub openurl { | |
my $url = shift; | |
my $platform = $^O; | |
my $cmd; | |
if ($platform eq 'darwin') { $cmd = "open \"$url\""; } # OS X | |
elsif ($platform eq 'MSWin32' or $platform eq 'msys') { $cmd = "start \"\" \"$url\""; } # Windows native or MSYS / Git Bash | |
elsif ($platform eq 'cygwin') { $cmd = "cmd.exe /c start \"\" \"$url \""; } # Cygwin; !! Note the required trailing space. | |
else { $cmd = "xdg-open \"$url\""; } # assume a Freedesktop-compliant OS, which includes many Linux distros, PC-BSD, OpenSolaris, ... | |
if (system($cmd) != 0) { | |
die "Cannot locate or failed to open default browser; please open '$url' manually."; |
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
using NUnit.Framework; | |
namespace Jaber.Tests | |
{ | |
using Microsoft.Extensions.Configuration; | |
/// <summary> | |
/// Just an example class that contains my special configuration | |
/// </summary> | |
public class MySpecialConfig |
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
private static Main() | |
{ | |
var outputFile = $"results_{taskId}.txt"; | |
using (var output = File.CreateText(WorkingDir(outputFile))) | |
{ | |
output.WriteLine("This is the results file"); | |
} | |
// Persist the task output to Azure Storage | |
Task.WaitAll( | |
taskStorage.SaveAsync(TaskOutputKind.TaskOutput, outputFile) |
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
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
/// <summary> | |
/// Simple helper to implement retry logic | |
/// </summary> | |
/// <example> | |
/// // Retry 5 times with a break of 30 seconds. | |
/// Retry.Do(() => MyMethod(), TimeSpan.FromSeconds(30), 5) |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch and set local branch to track the new remote |
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
public static class XmlExtensions | |
{ | |
/// <summary> | |
/// Cache serialization assemblies | |
/// </summary> | |
private static readonly Dictionary<RuntimeTypeHandle, XmlSerializer> serializer_cache = new Dictionary<RuntimeTypeHandle, XmlSerializer>(); | |
/// <summary> | |
/// used to remove obsolete xsd: and xsi: namespaces. | |
/// </summary> |
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
#!/bin/sh | |
# location: /etc/initramfs-tools/hooks/crypt_unlock.sh | |
PREREQ="dropbear" | |
prereqs() { | |
echo "$PREREQ" | |
} |
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
public sealed class Isolated<T> : IDisposable where T : MarshalByRefObject | |
{ | |
private AppDomain _domain; | |
private T _value; | |
public Isolated() | |
{ | |
_domain = AppDomain.CreateDomain("Isolated:" + Guid.NewGuid(), | |
null, AppDomain.CurrentDomain.SetupInformation); |
NewerOlder