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 useFormField = () => { | |
const fieldContext = React.useContext(FormFieldContext) | |
const itemContext = React.useContext(FormItemContext) | |
const { getFieldState, formState } = useFormContext() // comes from from react-hook-form | |
const fieldState = getFieldState(fieldContext.name, formState) | |
if (!fieldContext) { | |
throw new Error('useFormField should be used within <FormField>') | |
} |
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 { z } from 'zod' | |
export const signUpFormSchema = z.object({ | |
email: z.string().email('Invalid email'), | |
password: z | |
.string() | |
.min(6, { message: 'Password must be at least 6 characters' }), | |
confirmPassword: z | |
.string() | |
.min(6, { message: 'Password must be at least 6 characters' }), |
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
#!/usr/bin/env bash | |
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
# title Tokyo Night + | |
# version 1.0.0 + | |
# repository https://github.com/logico-dev/tokyo-night-tmux + | |
# author Lógico + | |
# email hi@logico.com.ar + | |
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
RESET="#[fg=brightwhite,bg=#15161e,nobold,noitalics,nounderscore,nodim]" |
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
{ | |
"compilerOptions": { | |
"lib": ["dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"strict": true, | |
"noEmit": true, | |
"esModuleInterop": true, | |
"module": "esnext", | |
"moduleResolution": "bundler", |
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 { CollectionsRepository } from '../repositories/collectionsRepository' | |
import { AuthenticationService } from './authenticationService' | |
import { CollectionsService } from './collectionsService' | |
interface ServiceMap { | |
AuthenticationService: AuthenticationService | |
CollectionsService: CollectionsService | |
} |
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 { CollectionsRepository } from '../repositories/collectionsRepository' | |
import { AuthenticationService } from './authenticationService' | |
import { CollectionsService } from './collectionsService' | |
export class ServiceLocator { | |
private static _cache: Record<string, any> | |
static { | |
console.log('Setting up cache') |
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
[ | |
// Navigation | |
{ | |
"key": "ctrl-h", | |
"command": "workbench.action.navigateLeft" | |
}, | |
{ | |
"key": "ctrl-l", | |
"command": "workbench.action.navigateRight" | |
}, |
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
// https://byby.dev/js-slugify-string | |
const slugify = function (str) { | |
return String(str) | |
.normalize("NFKD") // split accented characters into their base characters and diacritical marks | |
.replace(/[\u0300-\u036f]/g, "") // remove all the accents, which happen to be all in the \u03xx UNICODE block. | |
.trim() // trim leading or trailing whitespace | |
.toLowerCase() // convert to lowercase | |
.replace(/[^a-z0-9 -]/g, "") // remove non-alphanumeric characters | |
.replace(/\s+/g, "-") // replace spaces with hyphens | |
.replace(/-+/g, "-"); // remove consecutive hyphens |
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
// Name: tmux sesh | |
// Description: Atach to a tmux session | |
// Author: Lazar Nikolov | |
// Twitter: @NikolovLazar | |
import '@johnlindquist/kit'; | |
const sessionsCmd = await $`tmux list-sessions`; | |
let sessions = sessionsCmd.stdout |
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
// Name: tmux sesh | |
// Description: Opens a tmux session | |
import '@johnlindquist/kit'; | |
const sessionsCmd = await $`tmux list-sessions`; | |
let sessions = sessionsCmd.stdout; | |
sessions = sessions | |
.split('\n') |
NewerOlder