Skip to content

Instantly share code, notes, and snippets.

View itkrt2y's full-sized avatar
✂️
Yak Shaving

Tatsuya Itakura itkrt2y

✂️
Yak Shaving
View GitHub Profile
@itkrt2y
itkrt2y / page.rb
Last active April 12, 2023 16:23 — forked from rmosolgo/page_example.rb
Generic page number / per-page pagination with GraphQL-Ruby
class Page
DEFAULT_PAGE_SIZE = 20
def initialize(all_nodes, page:, per_page:)
@all_nodes = all_nodes
# Normalize pagination arguments
@page = if page.nil? || page < 1
1
else
page
@itkrt2y
itkrt2y / NumberInput.tsx
Last active April 19, 2022 12:01
react-hook-form + ChakraUI NumberInput
import {
NumberDecrementStepper,
NumberIncrementStepper,
NumberInput,
NumberInputField,
NumberInputStepper,
} from "@chakra-ui/react";
import { Controller } from "react-hook-form";
<Controller