Skip to content

Instantly share code, notes, and snippets.

View 844196's full-sized avatar

Masaya Takeda 844196

View GitHub Profile
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active October 14, 2024 00:05
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@td2sk
td2sk / update_qmk_c_cpp_properties.md
Last active March 24, 2023 17:39
tool for VSCode for QMK development

QMK VSCode 設定

概要

  • QMK の開発時に VSCode で補完が適切に効くようにするツール
  • qmk generate-compilation-database コマンドと違い、keymap.c でも適切に動作する

事前準備

最低限の設定を記載した $QMK_ROOT/.vscode/c_cpp_properties.json を事前に作成しておく

@mkcode
mkcode / .vscode-neovim-init.vim
Created October 5, 2022 20:17
Minimal yet functional config for VSpaceCode with VSCode-Neovim
" Our .vscode-neovim directory
let data_dir = '~/.vscode-neovim'
let plugFile = data_dir . '/plug.vim'
" Download plug.vim if it doesn't exist
" Then install the plugins in this file
if empty(glob(plugFile))
silent execute '!curl -fLo '.plugFile.' --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
execute "autocmd VimEnter * PlugInstall --sync | source " . expand('%:p')
@ww24
ww24 / README.md
Last active November 13, 2022 07:20
Docker Engine on Multipass for macOS
@Shrugsy
Shrugsy / rtkQueryCacheUtils.ts
Last active November 14, 2024 10:31
RTK Query cache utils. Useful abstractions for creating `provides`/`invalidates` cache data tags against endpoints.
import { FetchBaseQueryError } from '@rtk-incubator/rtk-query/dist';
/**
* Default tags used by the cacher helpers
*/
const defaultTags = ["UNAUTHORIZED", "UNKNOWN_ERROR"] as const;
type DefaultTags = typeof defaultTags[number];
function concatErrorCache<T, ID>(
existingCache: CacheList<T, ID>,
@eggbean
eggbean / eza-wrapper.sh
Last active October 15, 2024 14:08
Now moving from exa to eza fork. Wrapper script to give it nearly identical switches and appearance to ls. Also automatically adds --git switch when in a git repository.
#!/bin/bash
## Change following to '0' for output to be like ls and '1' for eza features
# Don't list implied . and .. by default with -a
dot=0
# Show human readable file sizes by default
hru=1
# Show file sizes in decimal (1KB=1000 bytes) as opposed to binary units (1KiB=1024 bytes)
meb=0
# Don't show group column
@MikuroXina
MikuroXina / sustainPlusPlus.java
Last active August 26, 2023 21:11 — forked from sam830917/Mili_sustainPlusPlus.java
Mili - sustain++; / Ghost In The Shell: SAC_2045 Ending Theme
package extraLarge;
/**
* The goal of this program is to obtain a HEALTHY
* and SUSTAINABLE relationship, darling.
*
* @author Cassie Wei from Mili
*/
public class sustainPlusPlus {
public static void main(String[] args) {
@Treeki
Treeki / TurnipPrices.cpp
Last active November 1, 2024 14:15
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active November 5, 2024 05:23
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@lex64
lex64 / refresh-env.sh
Last active August 16, 2023 16:39
Generate Laravel .env file from AWS Parameters Store
#!/bin/bash
PARAMATER="laravel-env"
REGION="eu-central-1"
WEB_DIR="/var/www/laravel"
WEB_USER="www-data"
# Get parameters and put it into .env file inside application root
aws ssm get-parameter --with-decryption --name $PARAMATER --region $REGION --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' -e 's/\\n/\n/g' -e 's/\\//g' > $WEB_DIR/.env