Skip to content

Instantly share code, notes, and snippets.

@andreas-it-dev
andreas-it-dev / Notification.vue
Last active November 8, 2020 11:11
Vuetify notification compononent
<template>
<div class="text-center">
<v-snackbar
v-model="notification.show"
:timeout="notification.timeout"
:color="notification.type"
>
{{ notification.message }}
<template v-slot:action="{ attrs }">
@andreas-it-dev
andreas-it-dev / NavBar.vue
Last active October 26, 2020 21:21
Nav bar for vuetify with theme switch
<template>
<v-app-bar app color="primary" dense :dark="isDark">
<v-app-bar-nav-icon></v-app-bar-nav-icon>
<div class="d-flex align-center">
<v-toolbar-title>Alpha IT</v-toolbar-title>
</div>
<v-spacer></v-spacer>
<v-menu>
@andreas-it-dev
andreas-it-dev / Signupform.vue
Last active November 8, 2020 11:08
vuetify made sign up form - inspired by https://www.youtube.com/watch?v=jWoy_LQydvk
<template>
<v-container id="signinup-form" class="fill-height">
<Notification
:message="snackbarMessage"
:snackbar="snackbar"
:type="snackbarType"
/>
<v-row align="center" justify="center" no-gutters>
<v-col cols="12" sm="8" md="8" class="">
<v-card class="evelation-12 card">
$.fn.keepInSync = function($targets) {
// join together all the elements you want to keep in sync
var $els = $targets.add(this);
$els.on("keyup change", function() {
var $this = $(this);
// exclude the current element since it already has the value
$els.not($this).val($this.val());
});
return this;
};
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :require_signin
private
def require_signin
unless current_user
redirect_to new_session_url, alert: 'Please sign in first!'
end
bundle exec rubocop
Inspecting 77 files
..............................W........C..............................W......
Offenses:
bin/spring:11:13: W: Assignment in condition - you probably meant to use ==.
if spring = lockfile.specs.find {|spec| spec.name == 'spring' }
^
test/test_helper.rb:5:7: C: Use nested module/class definitions instead of compact style.
# config valid only for current version of Capistrano
lock '3.6.1'
set :application, 'alphait'
set :repo_url, "git@host/repository.git"
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
force_ssl if: :ssl_configured?
before_action :set_locale
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
def default_url_options
class ContactMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.contact_mailer.message.subject
#
def message(message)
@message = message