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 { assertDefined } from './utils' | |
type AsyncFunc<T> = () => Promise<T> | |
export class MagicQueue<T> { | |
private isActive = false | |
private isKilled = false | |
private queue: AsyncFunc<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
export class UnknownError extends Error { | |
get name() { return this.constructor.name } | |
public detail: Readonly<string> | |
public error: Readonly<Error> | undefined | |
constructor({ detail, error }: { detail: string, error?: Error }) { | |
super( |
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
/** | |
* Checks if the given value is a valid constant in the given enum object. | |
* | |
* Details: https://github.com/microsoft/TypeScript/issues/30611#issuecomment-676431018 | |
* | |
* @param enumObj The enum object | |
* @param enumConstant The constant that must be present in the num | |
*/ | |
export function assertIsInEnum<T extends string, TEnumValue extends string>( | |
enumObj: { [key in T]: TEnumValue }, |
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 java.io.IOException; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.core.io.ClassPathResource; | |
import org.springframework.core.io.Resource; | |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
import org.springframework.web.servlet.resource.PathResourceResolver; | |
@Configuration | |
public class Config implements WebMvcConfigurer { |
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
module.exports = { | |
'env': { | |
'browser': true, | |
'es2021': true, | |
'node': true | |
}, | |
'extends': [ | |
'eslint:recommended', | |
'plugin:react/recommended', | |
'plugin:@typescript-eslint/recommended' |
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
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "[C] re-validate typescript", | |
// Find your TS compiler, it's usually here or globally as "tsc" | |
"command": "./node_modules/typescript/bin/tsc", | |
// Pass the arg "-p" and point to our tsconfig file | |
"type": "shell", | |
"args": [ |
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 me.sidbot.sandbox.repository; | |
public class UserRepository extends BaseRepository { | |
/** | |
* select all rows in the warehouses table | |
*/ | |
public void selectAll(){ | |
String sql = "SELECT id, name, capacity FROM warehouses"; | |
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
/* | |
TimeDiff.ahk | |
Usage: | |
TimeDiff.ShowTimeDiff() | |
*/ | |
class TimeDiff { | |
; Public API |
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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", | |
"font_face": "Inconsolata", | |
"font_size": 11, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], |
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
[ | |
// Material-Theme-Darker Patch | |
// ========================================================================== | |
// Sidebar Row Padding | |
// -------------------------------------------------------------------------- | |
{ | |
"class": "sidebar_tree", | |
}, |