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
namespace Samples | |
{ | |
using System; | |
using System.Collections.Generic; | |
public class CustomEnumerableDemoConsole | |
{ | |
public static void Main(params string[] args) | |
{ | |
CustomEnumerable enumerable = new CustomEnumerable("One", "Two", "Three"); |
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
$wsl2IP = (wsl hostname -I).Split(" ")[0] | |
Write-Host "Setting wsl2.local IP to the WSL2 IP ($wsl2IP)" | |
$hostsPath = "$env:windir\System32\drivers\etc\hosts" | |
$dockerHostsPattern = '^((\d{1,3}\.){3}\d{1,3}) wsl2\.local$' | |
$hosts = get-content $hostsPath | |
$hosts = $hosts | Foreach { | |
if ($_ -match $dockerHostsPattern) | |
{ | |
$oldIP = $Matches.1 |
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
:://call:: | |
SendInput, /status :phone: Call{enter} | |
Return | |
:://clear:: | |
SendInput, /status clear{enter} | |
Return | |
:://wfh:: | |
SendInput, /status :house_with_garden: Working From Home{enter} |
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
// ==UserScript== | |
// @name Jira copy story summary | |
// @namespace https://cravencode.com/ | |
// @version 0.1 | |
// @description Copies summary, issue link, and people associated with story to clipboard | |
// @match https://*.atlassian.net/* | |
// @copyright 2019, Cody Craven | |
// ==/UserScript== | |
(function(d) { |
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.IO; | |
using System.Linq; | |
using System.Reflection; | |
namespace FindAssemblyVersionConflicts | |
{ | |
class Program | |
{ |
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
function Find-GitLocalMerged { | |
Write-Host "git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'}}" | |
& git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | |
} | |
function Clean-GitLocalMerged { | |
Write-Host "git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_}" | |
& git branch --merged | %{$_.trim()} | ?{$_ -notmatch 'develop' -and $_ -notmatch 'master'} | %{git branch -d $_} | |
} |
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
function Reset-Git { | |
$target = '' | |
if ($args){ | |
$target = "origin/$args" | |
} | |
else { | |
$current = (&git rev-parse --abbrev-ref HEAD) | |
$target = "origin/$current" | |
} |
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
#Run this every 1/2 hour and in an 8 hour work day there will be approximately 3 times per day that your victim hears a cat fact | |
if ((Get-Random -Maximum 10000) -lt 1875) { | |
Add-Type -AssemblyName System.Speech | |
$SpeechSynth = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
$CatFact = (ConvertFrom-Json (Invoke-WebRequest -Uri 'http://catfacts-api.appspot.com/api/facts')).facts | |
$SpeechSynth.Speak("did you know?") | |
$SpeechSynth.Speak($CatFact) | |
} |
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
The regex patterns in this gist are intended only to match web URLs -- http, | |
https, and naked domains like "example.com". For a pattern that attempts to | |
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
# Single-line version: | |
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s |
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
// https://tools.ietf.org/html/rfc4648#section-5 | |
public class Base64Url | |
{ | |
public static string Encode(byte[] inArray) | |
{ | |
var base64 = Convert.ToBase64String(inArray); | |
return base64 | |
.Replace("+", "-") | |
.Replace("/", "_") | |
.Replace("=", ""); |
NewerOlder