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 client"; | |
| import React, { useState } from "react"; | |
| let a = { | |
| value: 0, | |
| foo: "asd", | |
| items: [1, 2, 3, 4], | |
| buyer: { | |
| name: "ime", |
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
| // utils | |
| async function* foo() { | |
| for (let i = 0; i < 3; i++) { | |
| await new Promise((r) => setTimeout(r, 1000)); | |
| yield i; | |
| } | |
| } | |
| const subToIter = (cb) => { | |
| const it = foo(); |
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 { Prisma } from '@prisma/client'; | |
| const selectOnUser = { | |
| id: true, | |
| name: true, | |
| } satisfies Prisma.UserSelect |
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 { Type } = require("@sinclair/typebox"); | |
| import fastify from "fastify"; | |
| const server = | |
| /** @type {import('fastify').FastifyInstance<any, IncomingMessage | Http2ServerRequest, ServerResponse<IncomingMessage> | Http2ServerResponse, FastifyBaseLogger, import('@fastify/type-provider-typebox').TypeBoxTypeProvider> } */ ( | |
| fastify().withTypeProvider() | |
| ); | |
| const ReturnSchema = Type.Object({ |
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 fastify = require("fastify"); | |
| const server = | |
| /** @type {import('fastify').FastifyInstance<any, IncomingMessage | Http2ServerRequest, ServerResponse<IncomingMessage> | Http2ServerResponse, FastifyBaseLogger, import('@fastify/type-provider-typebox').TypeBoxTypeProvider> } */ ( | |
| fastify().withTypeProvider() | |
| ); | |
| let ReturnSchema = { | |
| type: "object", | |
| properties: { |
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 sys | |
| import dataclasses | |
| @dataclasses.dataclass | |
| class Reindeer: | |
| name: str | |
| speed: int | |
| fly_time: int | |
| rest_time: int |
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
| /* Hide "Home" */ | |
| div[aria-label="Home timeline"] > :first-child > div > div:first-child { | |
| display: none; | |
| } | |
| /* Hide "For you / Followoing" */ | |
| div[aria-label="Home timeline"] > :first-child > div > div:nth-child(2) { | |
| display: none; | |
| } |
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
Show hidden characters
| { | |
| // "editor.lineNumbers": "relative", | |
| "vim.insertModeKeyBindings": [{ "before": ["j", "k"], "after": ["<Esc>"] }], | |
| "vim.visualModeKeyBindings": [ | |
| { "before": ["B"], "after": ["^"] }, | |
| { "before": ["E"], "after": ["$"] } | |
| ], | |
| "vim.normalModeKeyBindings": [ | |
| { "before": ["B"], "after": ["^"] }, | |
| { "before": ["E"], "after": ["$"] }, |
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
| console.log( | |
| JSON.stringify( | |
| Object.fromEntries( | |
| [...document.querySelectorAll(".config-vars tr")] | |
| .map((row) => [ | |
| row.querySelector(".config-var-key").value, | |
| row.querySelector(".config-var-value").value, | |
| ]) | |
| .filter((item) => !!item[0] && !!item[1]) | |
| ), |
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 client"; | |
| import { useCallback, useRef } from "react"; | |
| import { css } from "../../../styled-system/css"; | |
| function useLongPress( | |
| callback: (e: React.MouseEvent | React.TouchEvent) => void, | |
| shortClick: () => void, | |
| duration: number = 500 | |
| ) { |