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
fun main(args: Array<String>) { | |
val choosenMenu = menu { | |
fish | |
chips | |
hamburger | |
} | |
println(choosenMenu) | |
} |
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.myservice.infra.testinterceptor | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import org.springframework.http.HttpRequest | |
import org.springframework.http.HttpStatus | |
import org.springframework.http.client.ClientHttpRequestExecution | |
import org.springframework.http.client.ClientHttpRequestInterceptor | |
import org.springframework.http.client.ClientHttpResponse | |
import org.springframework.mock.http.client.MockClientHttpResponse | |
import java.io.File |
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 xmltomap; | |
import java.util.ArrayDeque; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.Deque; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.List; |
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 org.toilelibre.libe | |
import java.lang.reflect.Method | |
import kotlin.math.pow | |
import kotlin.reflect.KFunction | |
import kotlin.reflect.full.companionObject | |
import kotlin.reflect.full.companionObjectInstance | |
import kotlin.reflect.full.declaredFunctions | |
import kotlin.reflect.full.memberProperties |
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 CardType = 'MasterCard' | 'Visa' | 'American Express' | | |
'JCB' | 'Diners Club' | 'Discover' | 'unknown' | |
type MajorIndustryIdentifier = | |
'ISO/TC 68' | 'Airlines' | 'Travel and entertainment and banking/financial' | | |
'Banking and financial' | 'Merchandising and banking/financial' | | |
'Petroleum' | 'Healthcare and telecommunications' | 'National assignment' | | |
'unknown' | |
type CreditCardGuessedInformation = { |
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
const moment = function moment(textValue: string | number, format: string) { | |
const timeOfTheDay = /^([0-9]{1,2}):([0-9]{1,2})$/.exec((textValue || "").trim()) | |
const onlyTime = timeOfTheDay && new Date() | |
if (onlyTime && timeOfTheDay) onlyTime.setHours(parseInt(timeOfTheDay[1]), parseInt(timeOfTheDay[2])) | |
const date = !textValue ? new Date() : | |
!isNaN(textValue as number) ? new Date(textValue) : | |
!(textValue as string).trim() ? new Date() : | |
onlyTime ? onlyTime : new Date(textValue) | |
return { | |
date, |
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
{"weightsAndBiases":[[{"bias":-0.10071499664092819,"weights":[]},{"bias":-0.15018810063963497,"weights":[]}],[{"bias":-2.8468035812909434,"weights":[5.45721869905237,-3.148199059174658]},{"bias":-5.242078727744964,"weights":[-3.3284653639142725,10.876261776883684]},{"bias":-12.976066169035779,"weights":[36.003431279150426,6.242494143417826]},{"bias":-20.989904892589315,"weights":[13.402075212498223,51.79564730855186]}],[{"bias":-5.425858592065819,"weights":[-58.58740543154484,-32.269696973037284,18.54140361818438,10.084452534168838]}]],"parameters":["x","y"],"theory":"x^2+y^2<1","layersLength":[2,4,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 io.mockk.every | |
import io.mockk.mockk | |
import java.sql.* | |
import java.time.ZonedDateTime | |
import javax.sql.DataSource | |
object DatabaseSimulator { | |
val registeredSQLServerMappings = mutableMapOf<String, ResultSet>() | |
val calledStatements = mutableListOf<String>() |
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.mycompany.infra.config | |
import kotlinx.coroutines.CoroutineExceptionHandler | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Deferred | |
import kotlinx.coroutines.async | |
import kotlinx.coroutines.channels.Channel | |
import kotlinx.coroutines.channels.ReceiveChannel | |
import kotlinx.coroutines.channels.SendChannel | |
import kotlinx.coroutines.coroutineScope |
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.mycompany.library.tools | |
import org.springframework.boot.env.YamlPropertySourceLoader | |
import org.springframework.core.env.ConfigurableEnvironment | |
import org.springframework.core.env.Profiles | |
import org.springframework.core.io.ClassPathResource | |
object LoadYaml { | |
data class LoadOptions( |