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 | |
# dry run | |
g remote prune -n origin | |
# remove old local remote | |
g remote prune origin | |
# remove old local branches except main | |
g br | grep -ve main | xargs 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
type Mode = Passthrough | Mirroring | Filtering | Proxy | |
let main mode proxyRemoteUrl mirrorRemoteUrl mirrorRemoteApiKey hotels = | |
match mode, proxyRemoteUrl, mirrorRemoteUrl, mirrorRemoteApiKey with | |
| Proxy, _, Some mirrorUrl, Some mirrorApiKey -> sprintf "proxy, %s, %s" mirrorUrl mirrorApiKey | |
| _, None, _, _ -> sprintf "error : missing parameters to support any mode" | |
| Passthrough, Some url, _, _ -> sprintf "passthrough with %s" url | |
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
{{ define "googlechat.subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ if gt (.Alerts.Resolved | len) 0 }}, RESOLVED:{{ .Alerts.Resolved | len }}{{ end }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}{{ end }} | |
{{ define "googlechat.text_values_list" }}{{ if len .Values }}{{ $first := true }}{{ range $refID, $value := .Values -}} | |
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}{{ end -}} | |
{{ else }}[no value]{{ end }}{{ end }} | |
{{ define "googlechat.text_alert_list" }}{{ range . }} | |
Value: {{ template "googlechat.text_values_list" . }} | |
{{ if gt (len .PanelURL) 0 }}<a href="{{ .PanelURL }}">Open Panel</a> | |
{{ end }}{{ end }}{{ end }} |
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; | |
public class C { | |
private class D : IDisposable { | |
public D() | |
{ | |
} | |
public D(IDisposable _):this() { | |
} | |
public void Dispose(){ |
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 | |
find ./json -type f -name '*.json' -exec cat {} + | sort | uniq -c |
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
package com.adt; | |
import static org.junit.jupiter.api.Assertions.assertEquals; | |
import static org.junit.jupiter.api.Assertions.assertTrue; | |
import org.junit.jupiter.api.Test; | |
public class AdtTest { | |
sealed interface Value<T extends Comparable<T>> extends Comparable<Value<T>> permits Value.Fixed, Value.Infinite { |
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
// from https://github.com/cboudereau/adt-java17-presentation > https://github.com/fteychene/adt-java17-presentation | |
package com.example; | |
public class App { | |
public enum Direction { | |
NORTH, | |
SOUTH, | |
EAST, |
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
#[derive(Debug, Clone, Copy, PartialEq)] | |
enum Point { | |
Love, | |
Fifteen, | |
Thirty, | |
Forty, | |
} | |
impl Point { | |
fn next(&self) -> Self { |
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
type Point = Love | Fifteen | Thirty | Forty | |
module Point = | |
//TIP / Closure of operation : Can the score go backward ? | |
let next = function Love -> Fifteen | Fifteen -> Thirty | Thirty | Forty -> Forty | |
type Player = Left | Right | |
(* TIP / Primitive obsession | |
- Negative score |
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
package com.accorlight; | |
import java.util.function.Function; | |
public final class Result<R, E> { | |
final R value; | |
final E error; | |
public static class ResultException extends RuntimeException { | |
public ResultException(final String message) { |
NewerOlder