Skip to content

Instantly share code, notes, and snippets.

View frague59's full-sized avatar

François GUÉRIN frague59

View GitHub Profile
@frague59
frague59 / login.vue
Created January 6, 2021 09:44
Login page
<template>
<BCard>
<BCardHeader>
<BCardTitle><b class="fa fa-user"></b>&nbsp;Connexion</BCardTitle>
</BCardHeader>
<BCardBody>
<BForm ref="form" @submit.prevent="userLogin">
<BFormGroup
id="id-username-group"
label="Nom d'utilisateur"
auth: {
strategies: {
local: {
scheme: 'refresh',
token: {
property: 'access',
data: 'access',
maxAge: 60 * 30 // 30 minutes
},
refreshToken: {
@frague59
frague59 / default.vue
Created January 5, 2021 09:39
Default layout
<template>
<Header />
<main>
<Nuxt />
</main>
<Footer />
</template>
@frague59
frague59 / webpack.prod.js
Created December 11, 2020 09:21
PROD settings
/* Settings for PROD environment */
const common = require('./webpack.common')
const merge = require('webpack-merge')
const BundleTracker = require('webpack-bundle-tracker')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')
const config = merge(common, {
mode: 'production',
/**
* Common webpack settings for app
* */
const webpack = require('webpack')
const path = require('path')
const MomentLocaleWebpackPlugin = require('moment-locales-webpack-plugin')
const NODE_ENV = process.env.NODE_ENV
const BundleTracker = require('webpack-bundle-tracker')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
@frague59
frague59 / Actions.vue
Created December 11, 2020 09:06
Actions component
<template>
<div class="infos container">
<transition name="anim-fade-in">
<question
ref="question"
v-show="! isDone"
@done="onDone"
:question="question"
:debug="debug" />
</transition>
@frague59
frague59 / main.js
Created December 11, 2020 08:24
Vue main start file Vue main start file
import Vue from 'vue'
import { IconsPlugin, LayoutPlugin } from 'bootstrap-vue'
const Actions = require('./components/Actions.vue').default
Vue.use(LayoutPlugin)
Vue.use(IconsPlugin)
new Vue(
{
components: {Actions}
@frague59
frague59 / celeryd-workers.service.j2
Last active November 26, 2020 15:12
celeryd-workers
[Unit]
Description=Celery workers for **{{ project_name }}**
Documentation=http://gitlab.ville.tg/fguerin/intranet_wagtail/wikis/celery-settings
Requires=redis-server.service apache2.service mysql.service
[Service]
Type=simple
User={{ username }}
Group={{ apache_default_group }}
# RTMP settings
rtmp_auto_push on;
rtmp {
server {
listen 1935;
chunk_size 4096;
resolveManifsForLieu(payload) {
const $vue = this
$vue.manifList = []
DEBUG_SEARCH && console.debug(
`SearchPage::resolveManifsForLieu() payload = ${JSON.stringify(payload)}`
)
$vue.lieuIds = payload.itemId ? [payload.itemId] : payload.itemIds
const $params = {
date_start_after: todayPlusDays(-$vue.daysBefore).toISOString().substring(0, 10),
date_start_before: todayPlusDays($vue.daysAfter).toISOString().substring(0, 10)