This file contains hidden or 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
| Examiner updates his notification settings to receive reminder for every work 2 days early at 15:00 local time | |
| RescheduleUcomingExaminerWorkNotifications(examinerId) = | |
| Get examiner notification preferences | |
| Get examiner upcoming work assignments | |
| notifications = Calculate notifications for schedule | |
| for each | |
| date, time = take work assignment time | |
| date = Find {n}-th day before assignment date | |
| next notification date = date + time |
This file contains hidden or 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://martendb.io | |
| open Marten | |
| [<CLIMutable>] | |
| type User = | |
| { Id : Guid | |
| Name : string } | |
| let store = |
This file contains hidden or 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
| let inline (--) (x:string) (y:string) = x.Replace(y, String.Empty) | |
| module Wildcards = | |
| let private wildcardToRegular wc = | |
| "^" + Regex.Escape(wc).Replace("\\*", ".*") + "$" | |
| let accepts wildcard branch = | |
| let regex = wildcardToRegular wildcard | |
| let rgx = new Regex(regex, RegexOptions.IgnoreCase) | |
| rgx.IsMatch(branch) |
This file contains hidden or 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 GenericOptions<T> : IOptions<T> where T : class, new() | |
| { | |
| public GenericOptions(T value) | |
| { | |
| Value = value ?? throw new ArgumentNullException(nameof(value)); | |
| } | |
| public T Value { get; } | |
| } |
This file contains hidden or 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 Shutdown-PC { | |
| param ( | |
| [int] $Minutes = 5 | |
| ) | |
| $seconds = 60 * $Minutes | |
| $exp = "shutdown /s /t $seconds" | |
| $exp | Write-Host | |
| $exp | Invoke-Expression | |
| if($LASTEXITCODE -eq 0){ |
This file contains hidden or 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 ### | |
| function Git-Status { git status } | |
| Set-Alias gs Git-Status | |
| function Git-Log { | |
| $cmd = "git log -10 --oneline" | |
| Invoke-Expression $cmd | |
| } |
This file contains hidden or 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
| open Microsoft.FSharp.Collections | |
| /// Combines collection of Results into List of Values or Errors. | |
| /// List<Result<'a, 'b>> -> Result<List<'a>, List<'b>> | |
| let combine (results: List<Result<'a, 'b>>): Result<List<'a>, List<'b>> = | |
| let rec _combine (ok: List<'a>) (err: List<'b>) (res: List<Result<'a, 'b>>) = | |
| res |> List.tryHead | |
| |> function | |
| | None -> (ok, err) | |
| | Some curr -> |
This file contains hidden or 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
| ### Docker ### | |
| function Docker-PurgeImages { | |
| docker rmi $(docker images -q) | |
| } | |
| function Docker-PurgeContainers { | |
| docker rm $(docker ps -a -q) | |
| } |
This file contains hidden or 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 New-GitIgnore { | |
| param( | |
| [switch] $All = $false, | |
| [switch] $VisualStudio = $false, | |
| [switch] $VisualStudioCode = $false, | |
| [switch] $Rider = $false, | |
| [switch] $InteliJ = $false | |
| ) | |
| $url = "https://gitignore.io/api/" |
This file contains hidden or 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 ( | |
| [Parameter(Mandatory = $true)] $RepositoryPath, | |
| [Parameter(Mandatory = $true)] $Days | |
| ) | |
| function Get-BranchesInRepository([string]$path){ | |
| Push-Location | |
| try { | |
| Set-Location $path | |
| $branches = git for-each-ref --sort='-committerdate:iso8601' --format='%(committerdate:iso8601)|%(refname:short)|%(committeremail)|%(committername)' refs/remotes/ |