Skip to content

Instantly share code, notes, and snippets.

View munierujp's full-sized avatar
👨‍💻
Contribute to the world

Munieru munierujp

👨‍💻
Contribute to the world
View GitHub Profile
<template>
<v-btn
:color="button.color"
small
dark
@click="open"
>
<v-icon
small
left
<sup>[<i><a href="https://ja.wikipedia.org/wiki/%E8%A6%81%E5%87%BA%E5%85%B8">要出典</a></i>]</sup>
@munierujp
munierujp / echo_middleware_firebase_authentication.go
Last active August 14, 2024 04:19
Echo's middleware for Firebase Authentication
package middleware
import (
"context"
"strings"
"github.com/labstack/echo/v4"
firebase "firebase.google.com/go"
"google.golang.org/api/option"
(function (copy) {
main()
async function main () {
const rowElements = getRowElements()
console.log(`${rowElements.length}件のアイテムを取得開始します。`)
const items = await Promise.all(rowElements.map(async (rowElement) => {
const item = await toItem(rowElement)
console.log(`Done: ${item.title}`)
return item
function tryEscape (escape) {
return new Promise((resolve, reject) => {
try {
const result = escape()
resolve(result)
} catch (e) {
reject(e)
}
})
}
export const HttpMethod = {
Get: 'GET',
Head: 'HEAD',
Post: 'POST',
Put: 'PUT',
Delete: 'DELETE',
Connect: 'CONNECT',
Options: 'OPTIONS',
Trace: 'TRACE',
Patch: 'PATCH'
const KATAKANA_PATTERN = /[\u30A1-\u30FA]/g
function convertKatakanaToHiragana (katakana: string): string {
return katakana.replace(KATAKANA_PATTERN, toHiragana)
}
function toHiragana (katakana: string): string {
const code = katakana.charCodeAt(0) - 0x60
return String.fromCharCode(code)
}
function getRandomNumber (
min: number,
max: number
): number {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min)) + min
}
@munierujp
munierujp / sleep.ts
Last active September 25, 2022 14:04
const sleep = async (ms: number): Promise<void> => {
return await new Promise(resolve => setTimeout(resolve, ms))
}
((function () {
const backup = localStorage.getItem('backup')
const { data } = JSON.parse(backup)
const searchParams = new URLSearchParams(data)
const params = Object.fromEntries(searchParams)
console.log(params)
})()