Inspired by https://twitter.com/TkDodo/status/1734255363266843017?t=dOhCHPJJMd2bq2A8VK8R-A&s=19
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Text.Json.Serialization; | |
| using System.Text.RegularExpressions; | |
| namespace Mykeels.Solfa | |
| { | |
| [JsonConverter(typeof(JsonStringEnumConverter))] | |
| public enum Note | |
| { |
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, useState } from 'react'; | |
| type Query = `(min-width: ${number}px)` | `(max-width: ${number}px)`; | |
| export const Screens = { | |
| SM: `(max-width: 768px)`, | |
| MD: `(max-width: 1024px)`, | |
| LG: `(max-width: 1280px)`, | |
| XL: `(max-width: 1536px)`, | |
| } as const; |
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
| DROP TABLE IF EXISTS user_courses; | |
| DROP TABLE IF EXISTS users; | |
| DROP TABLE IF EXISTS courses; | |
| -- Create users table | |
| CREATE TABLE IF NOT EXISTS users ( | |
| id INT IDENTITY(1,1) PRIMARY KEY, | |
| user_name VARCHAR(100) NOT NULL | |
| ); |
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
| using System; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using ServiceStack.Model; | |
| using ServiceStack.OrmLite; | |
| using ServiceStack.OrmLite.Support; | |
| namespace YourNamespace | |
| { | |
| public static class LeftOuterJoinExtensions |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 { Page } from '@playwright/test'; | |
| export async function transformWebsocketMessage( | |
| page: Page, | |
| fn: <TMessage extends Record<string, unknown>>( | |
| url: string, | |
| message: TMessage | |
| ) => TMessage | |
| ) { | |
| fn = fn || ((url, message) => message); |
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
| // Use a conditional, because You may not want to provide swagger documentation in public environments | |
| if (_configuration.GetValue<bool>("SwaggerConfiguration:EnableSwagger")) | |
| { | |
| services.AddEndpointsApiExplorer(); | |
| services.AddSwaggerGen(options => { | |
| options.AddCustomIds(); | |
| options.AddMetadata(typeof(Program)); | |
| options.SchemaFilter<NullableEnumSchemaFilter>(); | |
| options.SchemaFilter<RequiredPropertiesSchemaFilter>(); |
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 { camelCase, pascalCase, snakeCase } from "change-case"; | |
| type CamelToPascalCase<S extends string> = S extends `${infer F}${infer R}` | |
| ? `${Capitalize<F>}${R}` | |
| : S; | |
| type PascalToCamelCase<S extends string> = S extends `${infer F}${infer R}` | |
| ? `${Uncapitalize<F>}${R}` | |
| : S; | |
| type SnakeToCamelCase<S extends string> = S extends `${infer F}_${infer R}` | |
| ? `${Uncapitalize<F>}${Capitalize<SnakeToCamelCase<R>>}` |
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 httpStatus from "http-status"; | |
| export const makeError = <TErrorName extends string>( | |
| name: TErrorName, | |
| message?: string | |
| ) => ({ | |
| name, | |
| message, | |
| }); |
NewerOlder