Skip to content

Instantly share code, notes, and snippets.

View YTakahashii's full-sized avatar
💫

Yuta Takahashi YTakahashii

💫
View GitHub Profile
@Quramy
Quramy / index.tsx
Last active April 11, 2024 15:34
Analogy RSC and GraphQL resolver
import { cache } from "react";
import DataLoader from "dataloader";
// backend service clients
import { getPopularPosts, getUserById, getUsers } from "@/services";
const memoizedGetUserById = cache(getUserById);
const getUserLoader = () =>
@mala
mala / meety_vuln.md
Last active December 18, 2023 05:36
Meety脆弱性 2022-11

Meety脆弱性 2022-11

文責 mala

経緯:

  • Meety退会しようと思ったがアカウントがなかったので、退会するためにアカウントを作ることにした。

免責:

  • 気になった範囲ですぐに見つかったもののうち、悪用可能なものを記載しています。
  • 好ましくないが仕様だろうというものは書いていません。
@edward-vo
edward-vo / .dockerignore
Created May 12, 2021 16:49
Next.js Dockerfile with Distroless
# Don't copy node_modules
node_modules
# Ignore common folders that we do not need
.next
.idea
.github
.vscode
type DeleteSpace<T extends string> =
T extends `${infer A} ${infer B}` ? `${DeleteSpace<A>}${DeleteSpace<B>}` :
T extends `${infer A} ${infer B} ${infer C} ${infer D} ${infer E} ${infer F} ${infer G} ${infer H} ${infer I} ${infer J} ${infer K} ${infer L} ${infer M} ${infer N} ${infer O} ${infer P} ${infer Q}`
? `${A}${B}${C}${D}${E}${F}${G}${H}${I}${J}${K}${L}${M}${N}${O}${P}${DeleteSpace<Q>}` :
T extends `${infer A} ${infer B} ${infer C} ${infer D}`
? `${A}${B}${C}${DeleteSpace<D>}` :
T extends `${infer A} ${infer B}` ? `${A}${DeleteSpace<B>}` : T
type DeleteLB<T extends string> = T extends `${infer A}\n${infer B}\n${infer C}\n${infer D}`
@khys
khys / settings.json
Created December 17, 2019 10:09
LaTeX Workshop に関する設定部分
{
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.tools": [
{
"command": "ptex2pdf",
"args": [
"-l",
"-i",
"-ot",
"-kanji=utf8 -synctex=1 -interaction=nonstopmode -halt-on-error -file-line-error",
@YTakahashii
YTakahashii / .commit_template
Last active February 1, 2019 19:08
Emoji prefix
# ==== Emojis ====
# 🎉 :tada: Initial commit
# 🔖 :bookmark: バージョンタグ
# 🐛 :bug: バグ修正
# ✏️ :pencil2: タイポ修正
# 👍 :+1: 機能改善
# ✨ :sparkles: 部分的な機能追加
# 💄 :lipstick: UIやスタイルファイルのアップデート
@hiroppy
hiroppy / saga.md
Last active July 13, 2020 04:44
redux-saga設計

構成要素

1. 一つの責務しか持たない saga

非同期イベントの場合は、success と failure を持ちます。

2. 1 を集めて処理のフローを定義する saga

基本的にこの saga が container からコールされます。(e.g. page のロード等)
ここでは複数の saga が処理順にかかれており、開始から終了までの処理が全て書かれることを想定します。

@rohitrawat
rohitrawat / sources.list
Created June 12, 2017 18:17
Ubuntu 16.04 Xenial default /etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
require 'prawn'
require 'prawn/table'
def bullet_item string
indent 15, 0 do
text "* " + string, :align => :justify
end
end
def bullet_item_2 string
@davisford
davisford / Setup MongoDB on localhost as Replica Set
Last active May 14, 2024 06:37
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1