View NumberInput.tsx
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 { | |
NumberDecrementStepper, | |
NumberIncrementStepper, | |
NumberInput, | |
NumberInputField, | |
NumberInputStepper, | |
} from "@chakra-ui/react"; | |
import { Controller } from "react-hook-form"; | |
<Controller |
View page.rb
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
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 |
View association.rb
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
# official docs: https://graphql-ruby.org/dataloader/sources.html | |
# app/graphql/sources/association.rb | |
class Sources::Association < ::GraphQL::Dataloader::Source | |
def initialize(association_name, scope = nil) | |
@association_name = association_name | |
@scope = scope | |
end | |
def fetch(records) |
View get-width-of-text-in-browser.js
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
document.createElement("canvas") | |
.getContext("2d") | |
.measureText("Hello こんにちは 😀") | |
.width; |
View file-base-routing-with-preact-vite-wouter.tsx
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 { Route, Switch } from "wouter-preact"; | |
const pageFiles = import.meta.globEager("./pages/**/*.tsx"); | |
const pages = Object.keys(pageFiles) | |
.sort() | |
.reverse() // Ensure the order of page file names. Put `:<filename>` to the end of the array. | |
.map((filePath) => { | |
const path = filePath.slice(8, -4).replace(/\/?index$/, ""); | |
const { Page } = pageFiles[filePath]; |
View docker-compose.yml
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
version: "3" | |
services: | |
db: | |
image: mysql:5.7 | |
container_name: sample-db | |
ports: | |
- 3344:3306 | |
volumes: | |
- ./db/mysql:/var/lib/mysql |
View open-pull-request
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
#!/bin/sh | |
# Required: hub, jq | |
commit=$1 | |
pr=$(hub api graphql -F query=" | |
{ | |
repository(name: \"{repo}\", owner: \"{owner}\") { | |
commit: object(expression: \"$commit\") { | |
... on Commit { |
View .eslintrc.js
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
/** @type import("eslint").Linter.Config */ | |
module.exports = { | |
env: { browser: true, node: true }, | |
parser: '@typescript-eslint/parser', | |
extends: [ | |
"eslint:recommended", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings", | |
"plugin:react/recommended", |
View install.sh
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
pacman -Syu \ | |
base-devel \ | |
docker \ | |
github-cli \ | |
hub \ | |
noto-fonts \ | |
noto-fonts-cjk \ | |
noto-fonts-emoji \ | |
neovim \ | |
yay \ |
View gnome-terminal-profile.dconf
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
[/] | |
audible-bell=false | |
background-color='rgb(15,15,15)' | |
bold-is-bright=false | |
default-size-columns=96 | |
default-size-rows=42 | |
palette=['rgb(0,0,0)', 'rgb(205,0,0)', 'rgb(0,205,0)', 'rgb(205,205,0)', 'rgb(30,144,255)', 'rgb(205,0,205)', 'rgb(0,205,205)', 'rgb(229,229,229)', 'rgb(127,127,127)', 'rgb(255,0,0)', 'rgb(0,255,0)', 'rgb(255,255,0)', 'rgb(72,111,213)', 'rgb(255,0,255)', 'rgb(0,255,255)', 'rgb(255,255,255)'] | |
visible-name='manjaro-custom' |
NewerOlder