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
let realFirstDigitRegex = Regex("one|two|three|four|five|six|seven|eight|nine|[0-9]") | |
let realLastDigitRegex = Regex("one|two|three|four|five|six|seven|eight|nine|[0-9]", RegexOptions.RightToLeft) | |
let matchToInt = function | |
| "one" -> 1 | |
| "two" -> 2 | |
| "three" -> 3 | |
| "four" -> 4 | |
| "five" -> 5 | |
| "six" -> 6 |
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://adventofcode.com/2023/day/1 | |
open System.Text.RegularExpressions | |
let firstDigitRegex = Regex("[0-9]") | |
let lastDigitRegex = Regex("[0-9]", RegexOptions.RightToLeft) | |
let sumOfCalibrationValues = | |
Seq.fold (fun acc (line: string) -> | |
let first = firstDigitRegex.Match(line).Value |> int |
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.thriveglobal.tracing.proxy | |
import ddtrot.dd.trace.bootstrap.instrumentation.api.AgentScope | |
import ddtrot.dd.trace.bootstrap.instrumentation.api.ScopeState | |
import java.lang.reflect.InvocationHandler | |
import java.lang.reflect.Method | |
import java.util.concurrent.ConcurrentHashMap | |
// this class is needed because DataDog relocates classes on purpose, so they are not available through reflection | |
// to overcome that we are building dynamic proxies for this and all returned objects |
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
/* | |
* Copyright 2016 Red Hat, Inc. and/or its affiliates | |
* and other contributors as indicated by the @author tags. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
object JwtHelpers { | |
data class KeyPair(val public: RSAPublicKey, val private: RSAPrivateKey) | |
// we need static keyPairs for consistent testing | |
val rsaKeyPair = run { | |
// keySize = 512 | |
// Choose two distinct prime numbers p and q. | |
val p = BigInteger("80015048226958274584861777197787136869318208410134237774308318008156105353397") | |
val q = BigInteger("84597213199129215561490406209976328146625812489295431631787994073201979267081") |
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 csharp | |
{ | |
using System.Linq; | |
public class Skynet | |
{ | |
static int children = 10; | |
static async Task<long> Loop(int level, long num) | |
{ |
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.thriveglobal.identity.keycloak.idp | |
import com.thriveglobal.identity.keycloak.utils.Utils.logger | |
import java.security.PrivateKey | |
import java.security.PublicKey | |
import java.util.* | |
import java.util.stream.Stream | |
import org.keycloak.broker.saml.SAMLIdentityProvider | |
import org.keycloak.broker.saml.SAMLIdentityProviderConfig | |
import org.keycloak.broker.saml.SAMLIdentityProviderFactory |
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.thriveglobal.connect.postgresql.junit | |
import com.thriveglobal.connect.postgresql.Env | |
import com.thriveglobal.env.CommonEnv | |
import java.time.Instant | |
import org.flywaydb.core.Flyway | |
import org.flywaydb.core.api.output.MigrateResult | |
import org.junit.jupiter.api.Tag | |
import org.junit.platform.engine.TestTag | |
import org.junit.platform.launcher.TestExecutionListener |
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
#r "nuget: Microsoft.AspNetCore.Server.Kestrel, 2.2.0" | |
#r "nuget: Microsoft.AspNetCore.Server.Kestrel.Core, 2.2.0" | |
#r "nuget: Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv, 2.2.0" | |
#r "nuget: Microsoft.AspNetCore.WebSockets, 2.2.0" | |
#r "nuget: Ply" | |
open System | |
open System.Net.WebSockets | |
open System.Text | |
open System.Threading |
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
#r "nuget: FSharp.Control.AsyncSeq, 3.2.1" | |
open System | |
open System.Threading.Channels | |
open System.Threading.Tasks | |
open FSharp.Control | |
// это наша асинхронная операция | |
let doWork x = task { | |
do! Task.Delay 100 |