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 bcrypt = require('bcrypt'); | |
| // Generate a salt and hash password | |
| async function hashPassword(password) { | |
| const COST_FACTOR = 12; // Higher = more secure but slower | |
| try { | |
| const hash = await bcrypt.hash(password, COST_FACTOR); |
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 {PrismaClientKnownRequestError} from '@prisma/client/runtime' | |
| import {NextApiRequest, NextApiResponse} from 'next' | |
| import {install, Repositorys, Logger} from 'nextjs-backend-helpers' | |
| import { | |
| createAccountArgumentsSchema, | |
| } from '../../../domains/accounts/schemas' | |
| import { | |
| AppController, | |
| } from '../../../domains/controllers/application-controller' | |
| import {rateLimit} from '../../../middleware/ratelimit' |
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
| { | |
| "xo": { | |
| "space": true, | |
| "rules": { | |
| "@typescript-eslint/semi": 0, | |
| "semicolon": 0, | |
| "import/extensions": 0, | |
| "unicorn/no-array-callback-reference": 0, | |
| "@typescript-eslint/member-delimiter-style": 0 | |
| } |
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
| @tailwind base; | |
| @tailwind components; | |
| @tailwind utilities; | |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap'); | |
| body { | |
| font-family: 'Inter', sans-serif; | |
| } |
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
| // LoadingButton.tsx | |
| import React from 'react' | |
| import { Button } from 'Button' | |
| const LoadingButton = (props) => { | |
| return <Button {...props} isLoading> loading... </Button> | |
| } | |
| // Button.tsx | |
| import React from 'react' |
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 request = require('request') | |
| module.exports.get = (url, options) => { | |
| return new Promise((resolve, reject) => { | |
| request.get(url, options, (err, response) => { | |
| if (err) { | |
| reject(err) | |
| } else { | |
| resolve(response) | |
| } |
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
| defmodule ZshRc do | |
| def read do | |
| "./.zshrc" |> File.read |> handle_result | |
| end | |
| def handle_result({:ok, value}) do | |
| value | |
| end | |
| def handle_result({:error, reason}) do |
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
| function handleChange({ preventDefault }) { | |
| preventDefault(); | |
| } |
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
| function handleChange({ target: { value }}) { | |
| console.log(value); | |
| } |
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
| function handleChange({ target }) { | |
| console.log(target.value); | |
| } |
NewerOlder