import { z } from "zod";
import { DateTime } from "luxon";
import { type TranslationValues } from "next-intl";
export const createDebtRecurrentOptions = ["WEEKLY", "BIWEEKLY", "MONTHLY"] as const;
export const createDebtTypeOptions = ["SINGLE", "RECURRENT"] as const;- Keep the components small, If the size exceeds 200-300 lines then create child components.
- JSX markup should be no more than 50 lines.
- Every function should have comments over it describing what it do.
- Code has no linter errors.
- If there are any React warnings reported in console, please solve that for example, Provide a key prop with a unique value for each element in array.
- Do not repeat your code (DRY).
- Code is in sync with existing code patterns.
- No unused props are being passed.
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
| export default function SessionsList() { | |
| const sessionsQuery = useSessionsListQuery(); | |
| return ( | |
| <PageLayout title="My sessions"> | |
| {matchQueryStatus(sessionsQuery, { | |
| Loading: ( | |
| <> | |
| <Skeleton height={70} mt={6} /> | |
| <Skeleton height={70} mt={6} /> |
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
| var GA = require('googleanalytics'), | |
| Table = require('cli-table'), | |
| util = require('util'); | |
| // API client. | |
| // You may need to enable API access to analytics for your account | |
| // here: https://code.google.com/apis/console | |
| var ga = new GA.GA({ | |
| "user": "myaccount@gmail.com", |
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
| /** | |
| This is a code of Google Apps Script for copying google drive folder content to other folder. | |
| ## Which situation the code resolve. | |
| Google doesn't allow to move folder content to other folder which is managed by | |
| other organization according to the policy of the GSUITE organization. | |
| And, Google doesn't allow to change the content owner to the user in other | |
| organizations. |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
- Open Telegram application then search for
@BotFather - Click Start
- Click Menu -> /newbot or type
/newbotand hit Send - Follow the instruction until we get message like so
Done! Congratulations on your new bot. You will find it at t.me/new_bot.
Are you having a trouble about SEO Meta in server while your project is SPA only like React Router or Vue Router?
Can i guess you also don't have so much time for migration on the new framework that can handle server side rendering out of the box like Next.js, Nuxt.js, Gatsby, etc.
Setting the SEO meta in server like <title>, <meta name="description"/> are actually useful for search engine, and also good for showing your summary content in social media app by pasted the full url in Whatsapp, IG, Twitter, etc.
The concept is actually simple, modify the index.html (from bundled source) before it served to the client.
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 { Container } from "./styles"; | |
| import { | |
| forwardRef, | |
| PropsWithChildren, | |
| useImperativeHandle, | |
| useRef, | |
| } from "react"; | |
| export type CursorProps = PropsWithChildren<{ | |
| className?: string; |
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 { colorToRgb, rgbToHex } from "./colorUtility"; | |
| function convertToDegree(matrix:Transform):number { | |
| const values = [...matrix[0], ...matrix[1]]; | |
| const a = values[0]; | |
| const b = values[1]; | |
| const angle = Number(((Math.atan2(b, a) * (180 / Math.PI)) + 90).toFixed(2)); | |
| return angle <= 0 ? angle + 360 : angle; | |
| } |
NewerOlder