Skip to content

Instantly share code, notes, and snippets.

@h-sakano
h-sakano / context.tsx
Last active April 16, 2020 06:45
auth0-spa-js(https://github.com/auth0/auth0-spa-js) with TypeScript
import createAuth0Client, {
Auth0Client,
Auth0ClientOptions,
GetIdTokenClaimsOptions,
GetTokenSilentlyOptions,
GetTokenWithPopupOptions,
IdToken,
LogoutOptions,
PopupConfigOptions,
PopupLoginOptions,
@h-sakano
h-sakano / _form.html.erb
Last active May 24, 2019 08:03
Devise registration
<%
options = {
url: form_url
}
options[:as] = resource_name if defined?(resource_name) && resource_name.present?
%>
<%= form_for(resource, options) do |f| %>
<% if !defined?(password_only) || !password_only %>
<%= f.email_field :email %>
@h-sakano
h-sakano / file1.txt
Last active December 17, 2018 02:19
GKEでロードバランサのIPを指定するとき、グローバルに属するIPアドレスリソースは使用できないので注意 ref: https://qiita.com/h-sakano/items/fe0ceed6214004b2e26f
Error creating load balancer (will retry): Failed to create load balancer for service default/eccube: requested ip xxx.xxx.xxx.xxx is neither static nor assigned to LB xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(default/hoge)
@h-sakano
h-sakano / config.yml
Last active December 16, 2018 14:33
Rails x CircleCI
version: 2.1
executors:
default:
working_directory: ~/repo
docker:
- image: circleci/ruby:2.5.1-node-browsers
environment:
RACK_ENV: test
RAILS_ENV: test
@h-sakano
h-sakano / file3.diff
Last active September 21, 2018 07:45
ActiveStorageを使用したモデルに関連するRequest SpecでActiveSupport::MessageVerifier::InvalidSignatureが発生する問題の解決策 ref: https://qiita.com/h-sakano/items/fc297f91a7bafc0b4d6d
- attached { fixture_file_upload Rails.root.join('spec', 'fixtures', 'files', 'test.jpg'), 'image/jpg' }
+
+ after(:build) do |hoge|
+ hoge.attached = fixture_file_upload(Rails.root.join('spec', 'fixtures', 'files', 'test.jpg'), 'image/jpg')
+ end
@h-sakano
h-sakano / signin.vue
Created September 19, 2018 03:46
Firebase Authentication signin page
<template>
<div>
<div class="row">
<div class="col s12 offset-m3 m6">
<div class="card">
<div class="card-content">
<span class="card-title">Sign in</span>
<p>
<div class="row">
<div class="col s12">
@h-sakano
h-sakano / GoogleSignin.vue
Created September 19, 2018 03:42
Firebase Authentication GoogleSignin Component
<template>
<a class="google-signin" @click="signInWithGoogleRedirect"></a>
</template>
<script lang="ts">
import {
Component,
Vue
} from "nuxt-property-decorator"
import firebase, { googleProvider } from "~/plugins/firebase"
@h-sakano
h-sakano / EmailSignUp.vue
Last active September 19, 2018 03:40
Firebase Authentication EmailSignup Component
<template>
<div>
<div class="row">
<div class="col s12">
<input type="text" placeholder="E-mail" v-model="email">
<input type="password" placeholder="Password" v-model="password">
</div>
</div>
<div class="row">
<div class="col s12">
@h-sakano
h-sakano / EmailSignin.vue
Created September 19, 2018 03:40
Firebase Authentication EmailSignin Component
<template>
<div>
<div class="row">
<div class="col s12">
<input type="text" placeholder="E-mail" v-model="email">
<input type="password" placeholder="Password" v-model="password">
</div>
</div>
<div class="row">
<div class="col s12">
@h-sakano
h-sakano / nuxt.config.js
Created September 19, 2018 03:30
Firebase Authentication nuxt.config.js
const parseArgs = require("minimist")
const argv = parseArgs(process.argv.slice(2), {
alias: {
H: "hostname",
p: "port"
},
string: ["H"],
unknown: parameter => false
})