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
| # sync failed for email privacy... fix git config then | |
| git commit --amend --reset-author --no-edit | |
| # The user wants to restore their version after the merge conflict. | |
| # They want to keep their local changes and discard the remote changes. | |
| git checkout --ours package.json | |
| git checkout --ours package-lock.json | |
| git add package.json package-lock.json | |
| # interrupt a merge, e.g. because you want to switch the order of your commit <--> pull commands |
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
| helm repo add grafana https://grafana.github.io/helm-charts | |
| helm repo update | |
| helm upgrade --install loki grafana/loki -n monitoring --create-namespace -f loki-values.yaml | |
| helm upgrade --install promtail grafana/promtail -n monitoring -f promtail-values.yaml | |
| helm install my-grafana grafana/grafana --namespace monitoring | |
| kubectl port-forward --namespace monitoring svc/my-grafana 3000:80 |
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 System | |
| open System.Security.Cryptography | |
| open System.Text | |
| type EncryptionInput = {key: string; plainText: string} | |
| type B64EncryptionOuput = {cipherText: byte array; tag: byte array; nonce: byte array} | |
| module myCrypt = | |
| let decrypt (encrypted: B64EncryptionOuput) (key: string) : string = |
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
| #r "nuget: GirCore.Gtk-4.0" | |
| open Gtk | |
| // https://mastodon.social/@lamg__/112546558109306665 | |
| let label () = | |
| let lb = new Label() | |
| lb.SetText "Hello!" | |
| lb |
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 System.Threading.Tasks | |
| open Npgsql.FSharp | |
| open Npgsql | |
| let connectionString : string = | |
| Sql.host "myhome" | |
| |> Sql.database "test_db" | |
| |> Sql.username "test_user" | |
| |> Sql.password "test123" | |
| |> Sql.port 5432 |
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
| see https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install | |
| wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh | |
| chmod +x ./dotnet-install.sh | |
| ./dotnet-install.sh --version latest | |
| /home/gitpod/.dotnet --version | |
| /home/gitpod/.dotnet/dotnet clean | |
| /home/gitpod/.dotnet/dotnet build |
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
| set CURL_CA_BUNDLE=C:\path\to\mycompanyCA.pem | |
| set PYTHONPATH=src | |
| python -m unittest test\mytest.py |
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
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: ubuntu | |
| labels: | |
| app: ubuntu | |
| spec: | |
| containers: | |
| - image: ubuntu | |
| command: |
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
| from zeep import Client | |
| wsdl = 'http://www.dneonline.com/calculator.asmx?WSDL' | |
| arg = {'intA':2, 'intB':3} | |
| op = 'Add' | |
| client = Client(wsdl) | |
| res = client.service[op](**arg) | |
| print(res) # 5 |
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
| import asyncio | |
| # weak dependencies list as (dependency, dependent) | |
| weak_deps = [(2,3),(4,1)] | |
| # e.g. let's say activity 2 updates input of activity 3 as a weak dependency, etc... | |
| async def gather_with_first_completed(awaitable_results): | |
| # Create a list to store the completed results | |
| completed_results = [] |
NewerOlder