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 lombok.NonNull; | |
| import lombok.SneakyThrows; | |
| import org.apache.commons.codec.binary.Base32; | |
| import org.springframework.lang.Nullable; | |
| import java.nio.charset.StandardCharsets; | |
| import java.security.MessageDigest; | |
| import java.util.Arrays; | |
| import java.util.Locale; | |
| import java.util.regex.Pattern; |
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 io.arleigh.gantry.cache.PrefixedKeyGenerator; | |
| import io.arleigh.gantry.properties.AppRedisProperties; | |
| import lombok.RequiredArgsConstructor; | |
| import lombok.Setter; | |
| import lombok.val; | |
| import org.redisson.api.RedissonClient; | |
| import org.redisson.jcache.configuration.RedissonConfiguration; | |
| import org.redisson.spring.cache.RedissonSpringCacheManager; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer; |
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 org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.context.annotation.Profile; | |
| import org.springframework.data.redis.core.RedisKeyValueAdapter; | |
| import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; | |
| import org.springframework.session.data.redis.config.ConfigureRedisAction; | |
| // https://dzone.com/articles/build-a-chat-application-using-spring-boot-websock | |
| // https://engineering.salesforce.com/lessons-learned-using-spring-data-redis-f3121f89bff9 | |
| // https://help.heroku.com/5BP0E8RC/how-to-enable-notify-keyspace-events-on-redis |
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 io.undertow.connector.ByteBufferPool; | |
| import io.undertow.server.DefaultByteBufferPool; | |
| import io.undertow.websockets.jsr.WebSocketDeploymentInfo; | |
| import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; | |
| import org.springframework.boot.web.server.WebServerFactoryCustomizer; | |
| import org.springframework.context.annotation.Configuration; | |
| @Configuration | |
| class UndertowConfig implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> { |
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 { AsyncContainerModule, Container as ContainerImpl, ContainerModule } from 'inversify'; | |
| import { Provider as IocProvider } from 'inversify-react'; | |
| import _ from 'lodash'; | |
| import { PropsWithChildren, useEffect, useState } from 'react'; | |
| const context = require.context('src', true, /\.config\.ts$|\.config\.tsx$|\.saga\.ts|\.events\.ts$/, 'lazy-once'); | |
| const keys = context.keys(); | |
| const getApplicationContext = _.once(async () => { | |
| const container = new ContainerImpl({ defaultScope: 'Request' }); |
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
| package com.teletapper.actuator; | |
| import com.teletapper.util.SecurityUtils; | |
| import lombok.Data; | |
| import lombok.Setter; | |
| import lombok.extern.slf4j.Slf4j; | |
| import lombok.val; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; | |
| import org.springframework.boot.actuate.endpoint.jmx.annotation.JmxEndpoint; |
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 { useEffect } from 'react'; | |
| const bpmToMillis = (bpm: number) => (bpm === 0 ? 0 : Math.round(60000.0 / bpm)); | |
| let vibrateInterval: number; | |
| function startVibrate(duration: number) { | |
| navigator.vibrate([duration, duration]); | |
| } |
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 { Channel, NotUndefined } from '@redux-saga/types'; | |
| import { Buffer, channel, EventChannel, Saga } from 'redux-saga'; | |
| import * as effects from 'redux-saga/effects'; | |
| import _ from 'lodash'; | |
| import { cast, isInteger } from 'src/util/invariant'; | |
| export type THandleRequest<T extends NotUndefined> = Saga<[Channel<T>]>; | |
| export type TCreatePipe<T extends NotUndefined> = Saga<[EventChannel<T>, Saga<[Channel<T>]>]>; | |
| export interface CreatePipeOptions { |
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 _ from 'lodash'; | |
| export namespace uuidUtil { | |
| const regexExp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi; | |
| export function isValidUuid(s: string) { | |
| if (!_.isString(s)) { | |
| return false; | |
| } | |
| if (_.isEmpty(s)) { |
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
| const { exec, getCurrentUrl } = require('preact-router'); | |
| export namespace urlUtil { | |
| export const getUrlParameter = (name: string, location: Pick<Location, 'pathname' | 'search'>): string | null => { | |
| if (typeof window === 'undefined') { | |
| return null; // shim | |
| } | |
| const a = 'http://localhost' /* <-- dummy string for parsing */ + location.pathname + location.search; | |
| const url = new URL(a); | |
| return url.searchParams.has(name) ? url.searchParams.get(name) : null; |