Skip to content

Instantly share code, notes, and snippets.

View novecentonove's full-sized avatar
🏠
Working from home

novecentonove novecentonove

🏠
Working from home
  • Italy
View GitHub Profile
@novecentonove
novecentonove / vue3-click-outside.js
Created June 28, 2021 11:13
Vue 3 click outside directive
const app = Vue.createApp({ .. })
app.directive("click-outside", {
beforeMount: function (el, binding) {
// Define ourClickEventHandler
const ourClickEventHandler = event => {
if (!el.contains(event.target) && el !== event.target) {
// as we are attaching an click event listern to the document (below)
@novecentonove
novecentonove / pdf-invoice.blade.php
Created March 16, 2021 17:14
Template for a invoice render with LAravel DomPDF
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aloha!</title>
<style type="text/css">
* {
font-family: Verdana, Arial, sans-serif;
}
@novecentonove
novecentonove / User.php
Last active June 28, 2021 11:17
Generate a Unique Id (short) for Laravel User Model
<?php
namespace App\Models;
use Illuminate\Support\Str;
use Spatie\Permission\Traits\HasRoles;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
@novecentonove
novecentonove / alpineAxios.html
Created July 30, 2020 21:23
Alpine js / Axios Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<title>Alpine and axios</title>
</head>
@novecentonove
novecentonove / symlink.php
Last active July 27, 2020 20:58
Create Laravel symlink in shared hosting
@novecentonove
novecentonove / single_quill_editor_with_js.php
Last active May 17, 2023 17:12
Quill Editor, post html data
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Quill Form</title>
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>