Skip to content

Instantly share code, notes, and snippets.

Hiroki Sakano h-sakano

Block or report user

Report or block h-sakano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@h-sakano
h-sakano / config.yml
Last active Dec 16, 2018
Rails x CircleCI
View config.yml
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 / signin.vue
Created Sep 19, 2018
Firebase Authentication signin page
View signin.vue
<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 Sep 19, 2018
Firebase Authentication GoogleSignin Component
View GoogleSignin.vue
<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 / EmailSignin.vue
Created Sep 19, 2018
Firebase Authentication EmailSignin Component
View EmailSignin.vue
<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 Sep 19, 2018
Firebase Authentication nuxt.config.js
View nuxt.config.js
const parseArgs = require("minimist")
const argv = parseArgs(process.argv.slice(2), {
alias: {
H: "hostname",
p: "port"
},
string: ["H"],
unknown: parameter => false
})
@h-sakano
h-sakano / auth.ts
Created Sep 19, 2018
Firebase Authentication Plugin
View auth.ts
import firebase from "~/plugins/firebase"
export default ({ app, redirect, store }) => {
app.router.afterEach((to, from) => {
firebase.auth().onAuthStateChanged((user) => {
store.commit("user/setUser", user)
if (user) {
if (to.name === "signin") {
redirect("/")
@h-sakano
h-sakano / index.ts
Created Sep 19, 2018
Firebase Authentication Store
View index.ts
export const strict = false
@h-sakano
h-sakano / EmailSignUp.vue
Last active Sep 19, 2018
Firebase Authentication EmailSignup Component
View EmailSignUp.vue
<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 / file3.diff
Last active Sep 21, 2018
ActiveStorageを使用したモデルに関連するRequest SpecでActiveSupport::MessageVerifier::InvalidSignatureが発生する問題の解決策 ref: https://qiita.com/h-sakano/items/fc297f91a7bafc0b4d6d
View file3.diff
- 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 / _form.html.erb
Last active May 24, 2019
Devise registration
View _form.html.erb
<%
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 %>
You can’t perform that action at this time.