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/bash | |
MESSAGE=$1 | |
pushd () { | |
command pushd "$@" > /dev/null | |
} | |
popd () { | |
command popd "$@" > /dev/null |
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/bash | |
# | |
# Written by Corey Haines | |
# Scriptified by Gary Bernhardt: https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn | |
# | |
# Put this anywhere on your $PATH (~/bin is recommended). Then git will see it | |
# and you'll be able to do `git churn`. | |
# | |
# Show churn for whole repo: | |
# $ git churn |
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
/usr/local/bin/fswatch -or -e ".git" -0 . | xargs -0 -n 1 -I {} /bin/zsh -c $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
import org.junit.jupiter.api.Assertions.assertNotNull | |
inline fun <reified T : Any> assertIsHiltViewModel() { | |
assertNotNull(Class.forName("${T::class.qualifiedName}_HiltModules")) | |
} |
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
class Verse: | |
def create(bottles): | |
return { | |
0: UltimateVerse(), | |
1: PenultimateVerse() | |
}.get(bottles, Verse(bottles)) | |
def __init__(self, bottles): | |
self.bottles = bottles |
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
def number(bottles): | |
return str(bottles) if 0 < bottles else "No" | |
def bottlesOfBeer(bottles): | |
s = "" if bottles == 1 else "s" | |
return f"{number(bottles)} bottle{s} of beer" | |
def passOne(bottles): |
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
param( | |
[String[]] $Files, | |
[String] $Run | |
) | |
$processes = @() | |
foreach ($f in $Files) { | |
$processes += Start-Process -FilePath $Run -ArgumentList $f -PassThru | |
} |
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 class Encrypted { | |
public string Value { get; set; } | |
public string Salt { get; set; } | |
} |
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 SecurityDriven.Inferno; | |
using System; | |
public class InfernoEncryptionProvider : IEncryptionProvider { | |
readonly IEncryptionConfiguration _configuration; | |
public InfernoEncryptionProvider(IEncryptionConfiguration configuration) { | |
_configuration = configuration; | |
} |
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; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Linq.Expressions; | |
public class MemoryDbSet<T> : IDbSet<T> where T : class { | |
readonly List<T> _list = new List<T>(); |
NewerOlder