Skip to content

Instantly share code, notes, and snippets.

View yusukebe's full-sized avatar
😃
Let's go!

Yusuke Wada yusukebe

😃
Let's go!
View GitHub Profile
@sor4chi
sor4chi / main.tsx
Created January 29, 2025 06:18
Hono SPA Router
import {
MouseEventHandler,
ReactNode,
StrictMode,
useCallback,
useSyncExternalStore,
} from "react";
import { createRoot } from "react-dom/client";
import { Hono } from "hono";
import { Action, createBrowserHistory, Update } from "history";
@mackee
mackee / go.mod
Created March 4, 2022 13:54
The `perl` fall block game
module github.com/mackee/sandbox/goperlfallblock
go 1.16
require (
github.com/JoelOtter/termloop v0.0.0-20210806173944-5f7c38744afb // indirect
github.com/Songmu/strrand v0.0.0-20181014100012-5195340ba52c // indirect
github.com/nsf/termbox-go v1.1.1 // indirect
)
@toricls
toricls / lima-on-m1-mac-installation-guide.md
Last active November 9, 2024 23:03
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@tavinus
tavinus / puppeteerDebianHeadless.md
Created September 11, 2020 09:14
Minimal Puppeteer NodeJS Debian 10 Buster

System

Debian 10 Buster headless

Chromium dependencies

Shared Libraries needed

$ sudo apt install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0

Install nvm

Local user

/**
* A bookmarklet for viewing the largest contentful paint in a page.
* Will show each LCP after the bookmarklet is clicked.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
javascript:(function(){
try {
@Integralist
Integralist / main.vcl
Last active November 15, 2021 13:18
[Fastly Varnish Serve Stale Testing] #fastly #varnish #vcl #cdn #cache #stale #stale-while-revalidate #stale-if-error
include "serve_stale_verification"
sub vcl_fetch {
#FASTLY fetch
...
call serve_stale_verification;
if (beresp.status >= 500 && beresp.status < 600) {
@CSTDev
CSTDev / auto-increment-version.sh
Last active October 23, 2024 23:42
Script that will find the last Git Tag and increment it. It will only increment when the latest commit does not already have a tag. By default it increments the patch number, you can tell it to change the major or minor versions by adding #major or #minor to the commit message.
#!/bin/bash
#get highest tag number
VERSION=`git describe --abbrev=0 --tags`
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })
#get number parts and increase last one by 1
VNUM1=${VERSION_BITS[0]}
@dgrigg
dgrigg / webpack.config.js
Created May 30, 2019 18:19
Webpack + Twig setup
const webpack = require('webpack');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ManifestPlugin = require('webpack-manifest-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const WebpackNotifierPlugin = require('webpack-notifier');
const TailwindCss = require('tailwindcss');
const AutoPrefixer = require('autoprefixer');
const path = require('path');
@kenmori
kenmori / Apollo x Reley Style Corsele PageNation(リレースタイルカーソルページネーション).md
Last active March 31, 2022 13:39
Apollo x Relay-Style-Cursor-Pagination(リレースタイルカーソルページネーション)

Apollo x Relay-Style-Cursor-Pagination(リレースタイルカーソルページネーション)

この記事は「GraphQL with React入門 - QueryとMutationを学びPaginationの実装にチャレンジ!」(https://www.udemy.com/graphql-with-react/) で学んだ知見をまとめたものです。

自分がapollo x graphQLを使うにあたって非常に役立った動画ですので。初学者におすすめです。

// Builderオブジェクトの型
type Builder<Props, Result> = ({} extends Props
? {
build: () => Result;
}
: {}) &
{ [P in keyof Props]-?: SetFunction<Props, P, Result> };
type SetFunction<Props, K extends keyof Props, Result> = (
value: Exclude<Props[K], undefined>