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
senders: | |
smsSender: { | |
messageTitle: "Hello from ThunderOTP!", | |
messageTemplate: "Your OTP is: #{otp}, you must take care of it's valid for 5 minutes.", | |
otpLength: 5, | |
useLetters: false, | |
useDigits: true, | |
ttlMinutes: 5, | |
accountSid: "secret", | |
serviceKey: "secret", |
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 Application.configureRouting() { | |
install(StatusPages) { | |
exception<RequestValidationException> { call, cause -> | |
call.respond(HttpStatusCode.BadRequest, | |
ErrorType.REQUEST_VALIDATION_FAILED.toErrorResponseDTO().copy(details = cause.reasons.joinToString())) | |
} | |
configureAuthorizedClientsStatusPages() | |
configureOtpStatusPages() | |
} | |
routing { |
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
graalvmNative { | |
binaries { | |
named("main") { | |
fallback.set(false) | |
verbose.set(true) | |
buildArgs.add("--initialize-at-build-time=io.ktor,kotlin,ch.qos.logback,kotlinx.serialization,org.slf4j,io.netty") | |
buildArgs.add("--initialize-at-build-time=kotlinx.coroutines") | |
buildArgs.add("--initialize-at-run-time=io.netty.channel.DefaultFileRegion") | |
buildArgs.add("--initialize-at-run-time=io.netty.channel.epoll.Native") | |
buildArgs.add("--initialize-at-run-time=io.netty.channel.epoll.Epoll") |
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 {Field} from "formik"; | |
import {Form} from "whatever-library-you-use"; | |
const FieldInputWrapper = (props) => <Field {...props} as={Form.Input} />; | |
export {FieldInputWrapper} | |
import styled from 'styled-components'; | |
import { FieldInputWrapper } from 'wherever' |
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 { Form, Formik } from 'formik'; | |
import React from 'react'; | |
export const FormHolder = ({ initialValues, onSubmit, validationSchema, children}) => { | |
return ( | |
<Formik | |
initialValues={initialValues} | |
onSubmit={onSubmit} | |
validationSchema={validationSchema} | |
validateOnChange={false} |
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 styled from 'styled-components'; | |
const StyledButton = styled(Button)` | |
color: ${({ theme }) => theme.colors.primary}; | |
`; | |
const primary = 'green'; | |
const theme = { | |
colors: { | |
primary, | |
} | |
} |
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 Title = styled.h1` | |
font-size: 1.5em; | |
text-align: center; | |
color: palevioletred; | |
`; | |
// Create a Wrapper component that'll render a <section> tag with some styles | |
const Wrapper = styled.section` | |
padding: 4em; | |
background: papayawhip; | |
`; |
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
[...] | |
struct ComplicationCorner : View { | |
var entry: QuoteEntry | |
var body: some View { | |
Image(systemName:"quote.bubble") | |
.widgetLabel { | |
Text(entry.quote.quote) | |
.widgetAccentable(true) | |
} | |
.unredacted() |
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
func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) { | |
var entries: [QuoteEntry] = [] | |
// Generate a timeline consisting of five entries minute apart, starting from the current date. | |
let currentDate = Date() | |
for hourOffset in 0 ..< 5 { | |
let quote = quoteManager.getSingleQuote() | |
let entryDate = Calendar.current.date(byAdding: .minute, value: hourOffset, to: currentDate)! | |
let entry = QuoteEntry(date: entryDate, quote: quote) | |
entries.append(entry) | |
} |
NewerOlder