Skip to content

Instantly share code, notes, and snippets.

View tatsuyasusukida's full-sized avatar

Tatsuya Sususkida tatsuyasusukida

View GitHub Profile
@tatsuyasusukida
tatsuyasusukida / .env.example
Created August 7, 2022 00:05
🪙 How to create your own ERC-20 Token
API_URL="https://eth-goerli.g.alchemy.com/v2/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000"
ETHERSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
CONTRACT_ADDRESS="update after deploying"
@tatsuyasusukida
tatsuyasusukida / form.tsx
Created August 4, 2022 08:09
📝 How to make a form without react hook form
import { useState } from "react"
import { makeValidationProfile, validateProfile } from "../lib/validate"
export default function Form () {
const [form, setForm] = useState({first: '', last: ''})
const [validation, setValidation] = useState(makeValidationProfile)
const onSubmit = (event: any) => {
event.preventDefault()
@tatsuyasusukida
tatsuyasusukida / .env.example
Last active August 3, 2022 00:43
🗃️ How to upload files from browser to Google Cloud Storage
PORT="3000"
BUCKET="gcp-file-upload-00000000"
@tatsuyasusukida
tatsuyasusukida / go.mod
Last active August 1, 2022 06:26
Cloud Run golang redirect server
module loremipsum.co.jp/redirect
go 1.18
@tatsuyasusukida
tatsuyasusukida / .env.example
Last active July 26, 2022 05:00
🐈 How to update Gist from the terminal
GIST_ID="00000000000000000000000000000000"
@tatsuyasusukida
tatsuyasusukida / .env.example
Last active July 25, 2022 01:58
👷 How to deploy smart contracts in Mumbai
API_URL="https://matic-mumbai.chainstacklabs.com"
PRIVATE_KEY="0000000000000000000000000000000000000000000000000000000000000000"
POLYGONSCAN_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
CONTRACT_ADDRESS="0x0000000000000000000000000000000000000000"
@tatsuyasusukida
tatsuyasusukida / .env
Last active July 20, 2022 21:56
🌳 How to use .env environment variables from package.json script
MESSAGE="Hello World"
@tatsuyasusukida
tatsuyasusukida / .gitignore
Last active July 19, 2022 23:26
♯ How to compress jpeg images with sharp
/img/
/img-original/
/node_modules/
/package-lock.json
# Do not ignore package-lock.json other than gist
@tatsuyasusukida
tatsuyasusukida / config.example.mjs
Last active February 20, 2023 06:04
🏎 How to upload files to Google Drive without library
export default {
clientId: '000000000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
}
@tatsuyasusukida
tatsuyasusukida / article.mjs
Created June 28, 2022 23:39
🚀 How to migrate from CJS to ESM with Sequelize: ESM part
export default function article (sequelize, DataTypes) {
const article = sequelize.define('article', {})
article.associate = (models) => {
article.belongsTo(models.user)
}
return article
}