Skip to content

Instantly share code, notes, and snippets.

View syuji-higa's full-sized avatar
💭
I may be slow to respond.

HIGA Syuji syuji-higa

💭
I may be slow to respond.
View GitHub Profile
@syuji-higa
syuji-higa / open-api-grpc-error-code.yml
Last active October 25, 2021 04:22
OpenAPI 3.0 gRPC Error Code
# 400 Status Code
BadRequestStatusCode:
type: string
enum: # gRPC Status Code
- INVALID_ARGUMENT
- FAILED_PRECONDITION
- OUT_OF_RANGE
# 401 Status Code
UnauthorizedStatusCode:
type: string
@syuji-higa
syuji-higa / index.js
Created October 7, 2020 07:46
Node.js - local server
const { join } = require('path')
const express = require('express')
const app = express()
app.use(express.static(join(__dirname, 'docs')))
const host = 'localhost'
const port = 3000
app.listen(port, host, () => {
@syuji-higa
syuji-higa / index.js
Created August 21, 2020 09:20
Node.js - https local server
const { join } = require('path')
const { readFileSync } = require('fs')
const express = require('express')
const app = express()
const https = require('https')
app.use(express.static(join(__dirname, 'docs')))
const server = https.createServer({
key: readFileSync('localhost-key.pem'),
@syuji-higa
syuji-higa / create-google-cloud-build-and-run-nextjs.sh
Last active January 3, 2023 00:54
Create a CI/CD environment for Next.js in Google Cloud Build & Run
gcloud alpha billing accounts list
echo "> Please select the billing account ID from the displayed and enter."
read GC_ACCOUNT_ID
echo "> Please enter a common project name for GitHub and GCP."
read PROJECT_NAME
echo "> Enter Cloud Run Location. (Recommendation is 'asia-northeast1' region)"
read GC_REVISION
const internalIp = require('internal-ip')
const express = require('express')
const proxy = require('express-http-proxy')
const app = express()
require('colors')
const isLocalIpHosting = process.argv[2] === 'local-ip-hosting'
;(async() => {
@syuji-higa
syuji-higa / .zshrc
Last active March 17, 2020 02:56
zinit setting
autoload -Uz compinit && compinit
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing DHARMA Initiative Plugin Manager (zdharma/zinit)…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
@syuji-higa
syuji-higa / .eslintrc.js
Created February 13, 2020 06:06
ESLint - ignore setting (v6.7.0~)
module.exports = {
ignorePatterns: []
}
@syuji-higa
syuji-higa / DefaultButton.vue
Created December 25, 2019 06:56
Vue.js - SFC generic components
<template>
<component
:is="tag"
class="small-button-component"
:disabled="isDisabled"
v-bind="attrs"
v-on="$listeners"
>
{{ text }}
</component>
@syuji-higa
syuji-higa / DefaultButton.vue
Created December 25, 2019 06:56
Vue.js - SFC generic components
<template>
<component
:is="tag"
class="small-button-component"
:disabled="isDisabled"
v-bind="attrs"
v-on="$listeners"
>
{{ text }}
</component>
@syuji-higa
syuji-higa / index.vue
Created December 18, 2019 04:44
Nuxt.js - Navigation Guard
<template>
<div>
<div v-if="isLeavePageDialogOpened" class="page-leave-dialog">
<p>Are you sure you want to change the page?</p>
<div>
<button type="button" @onClick="leavePageNext(false)">No</button>
<button type="button" @onClick="leavePageNext(true)">Yes</button>
</div>
</div>
</div>