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
export namespace idUtil { | |
export function create() { | |
let str = ''; | |
for (let i = 0; i < 16; i += 1) { | |
const base = 'abcdefghijklmnopqrstuvwxyz234567'; //a-z, 2-7 | |
const array = new Int32Array(1); | |
window.crypto.getRandomValues(array); | |
const j = array[0]; | |
str += | |
base[(j >>> 27) & 0x1f] + |
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 _ from 'lodash'; | |
const invoke = new Proxy(_.invoke, { | |
apply(target, thisArg, argArray: any[]): any { | |
try { | |
return Reflect.apply(target, thisArg, argArray); | |
} catch (e) { | |
if (process.env.NODE_ENV === 'development') { | |
console.debug('[safe-invoke] discarding exception', e, ...argArray); | |
} |
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 lombok.NonNull; | |
import lombok.RequiredArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.springframework.util.Assert; | |
import org.springframework.web.socket.CloseStatus; | |
import org.springframework.web.socket.WebSocketHandler; | |
import org.springframework.web.socket.WebSocketMessage; | |
import org.springframework.web.socket.WebSocketSession; | |
import org.springframework.web.socket.handler.WebSocketHandlerDecorator; | |
import org.springframework.web.socket.handler.WebSocketHandlerDecoratorFactory; |
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 { createRef, PureComponent, RefObject } from 'react'; | |
import { Field, RenderableProps, UseFieldConfig } from 'react-final-form'; | |
import { ExclamationCircleIcon } from '@heroicons/react/24/outline'; | |
import _ from 'lodash'; | |
export interface ActiveFieldProps { | |
attribute: string; | |
label?: string; | |
type?: string; | |
component?: RenderableProps<any>['component']; |
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
// ============================================================================ | |
// patches node_modules/reactstrap for compatibility with preact | |
// ============================================================================ | |
const glob = require('glob'); | |
const fs = require('fs'); | |
function resolvePath(moduleId = 'reactstrap') { | |
try { | |
const resolved = require.resolve(moduleId); |
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 lombok.Setter; | |
import lombok.extern.slf4j.Slf4j; | |
import lombok.val; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationContextAware; | |
import org.springframework.http.server.ServerHttpRequest; | |
import org.springframework.http.server.ServerHttpResponse; | |
import org.springframework.http.server.ServletServerHttpRequest; | |
import org.springframework.lang.Nullable; | |
import org.springframework.security.core.session.SessionInformation; |
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
plugins { | |
id 'org.springframework.boot' | |
id 'io.spring.dependency-management' | |
id 'java' | |
id 'idea' | |
id 'io.freefair.lombok' version "${freefairPluginVersion}" // 6.0.0-m2 | |
} | |
configurations { | |
rt |
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 lombok.RequiredArgsConstructor; | |
import lombok.val; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.env.Environment; | |
import org.springframework.lang.NonNull; | |
import org.springframework.messaging.simp.config.MessageBrokerRegistry; | |
import org.springframework.messaging.simp.config.StompBrokerRelayRegistration; | |
import org.springframework.session.Session; | |
import org.springframework.session.web.socket.config.annotation.AbstractSessionWebSocketMessageBrokerConfigurer; |
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
export interface TypedEventListener<T> { | |
(event: T): void; | |
} | |
export interface TypedEventDisposable { | |
dispose: () => void; | |
} | |
export class TypedEvent<T> { | |
private readonly listeners: TypedEventListener<T>[] = []; |
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 _ from 'lodash'; | |
const DEFAULT_ERROR_MESSAGE = 'Invariant Type Violation'; | |
export class InvariantError extends Error { | |
constructor(message = DEFAULT_ERROR_MESSAGE) { | |
super(message); | |
} | |
} |