Skip to content

Instantly share code, notes, and snippets.

@Julien1138
Julien1138 / Editor.vue
Last active Oct 3, 2021
Tiptap collaboration server handles multiple document using namespaces and rooms
View Editor.vue
<template>
<div class="editor">
<template v-if="editor && !loading">
<div class="count">
{{ count }} {{ count === 1 ? 'user' : 'users' }} connected to {{ projectPath }}/{{ docName }}
</div>
<editor-content class="editor__content" :editor="editor" />
</template>
<em v-else>
Connecting to socket server …
View Dockerfile
FROM ubuntu:20.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
ARG XDEBUG
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
View launch.json
{
"name": "Listen for XDebug on Docker App",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"hostname": "localhost",
"xdebugSettings": {
View docker-compose.yml
laravel.test:
build:
context: ./docker/8.0
dockerfile: Dockerfile
args:
WWWGROUP: "${WWWGROUP}"
XDEBUG: ${SAIL_DEBUG}
image: sail-8.0/app
ports:
- "${APP_PORT:-80}:80"
View php.ini
[XDebug]
zend_extension = xdebug.so
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.discover_client_host = true
xdebug.idekey = VSC
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003
View launch.json
{
"name": "Listen for XDebug on Docker App",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"hostname": "localhost",
"xdebugSettings": {
View FormElement.vue
<template>
<div class="form-element">
<div>{{ field.title }}</div>
<slot :field="field"></slot>
<div v-if="empty" class="empty">Must not be empty</div>
</div>
</template>
View CustomForm.vue
<template>
<div>
<FormElement :field="name">
<template v-slot="{field}">
<input v-model="field.value">
</template>
</FormElement>
<FormElement :field="description">
<template v-slot="{field}">
<textarea v-model="field.value"/>
View FormElement.vue
<template>
<div class="form-element">
<div>{{ field.title }}</div>
<slot :value="field.value" :update="update"></slot>
<div v-if="empty" class="empty">Must not be empty</div>
</div>
</template>
View CustomForm.vue
<template>
<div>
<FormElement :field="name">
<template v-slot="{value, update}">
<input :value="value" @input="update">
</template>
</FormElement>
<FormElement :field="description">
<template v-slot="{value, update}">
<textarea :value="value" @input="update"/>