Skip to content

Instantly share code, notes, and snippets.

View mathieutu's full-sized avatar
🚴

Mathieu TUDISCO mathieutu

🚴
View GitHub Profile
@mathieutu
mathieutu / 00-laravel-deploy.sh
Created September 7, 2023 10:45
Laravel Docker prod conf
# scripts/00-laravel-deploy.sh
php artisan route:cache
php artisan view:cache
php artisan config:cache
php artisan migrate --force
@mathieutu
mathieutu / .finicky.js
Created September 21, 2022 09:07
Finicky config
module.exports= {
defaultBrowser: "Browserosaurus",
handlers: [
{
match: "meet.google.com/*",
browser: {
name: "Arc",
},
},
{
@mathieutu
mathieutu / no-react-node.js
Created March 10, 2022 14:20
Enforces never using React.ReactNode as the typing is wrong.
const MODULE = "common/types/react";
module.exports = {
meta: {
type: "problem",
docs: {
url:
"https://changelog.com/posts/the-react-reactnode-type-is-a-black-hole",
description: `Enforces never using React.ReactNode as the typing is wrong.`,
category: "react",
@mathieutu
mathieutu / gist:ed96070b880aeddff10a8afe6352f9da
Created January 4, 2022 17:13
iterm alfred integration
-- This is v0.7 of the custom script for AlfredApp for iTerm 3.1.1+
-- created by WangJia hmfight@qq.com
-- github: https://github.com/hmfight
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \":Applications:iTerm.app\"
activate
@mathieutu
mathieutu / HasUuid.php
Created July 6, 2021 10:17
uuid handling trait for eloquent models
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Ramsey\Uuid\Uuid;
trait HasUuid
{
@mathieutu
mathieutu / reactive.js
Created April 6, 2021 21:54
Simple vuejs 3 like reactivity poc.
const reactiveMap = new WeakMap()
const targetMap = new WeakMap()
let activeEffect
const track = (target, key) => {
if (!activeEffect) return
let depsMap = targetMap.get(target)
@mathieutu
mathieutu / app.php
Created December 17, 2020 17:12
Translation Dsécu.
<?php
use App\Models\Client;
use App\Models\Commande;
use App\Models\CommandeLigne;
use App\Models\Utilisateurs\Admin;
use App\Models\Utilisateurs\ADV;
use App\Models\Utilisateurs\Commercial;
use App\Models\Utilisateurs\Contact;
@mathieutu
mathieutu / ListeModelsAttributesAndRelations.php
Created November 15, 2020 00:51
List Laravel models attributes and relations.
<?php
namespace App\Console\Commands;
use App\Helpers\RelationsInModelFinder;
use App\Models\Model;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Schema;
use Symfony\Component\Finder\SplFileInfo;
@mathieutu
mathieutu / useState.ts
Created October 19, 2020 08:26
A test of a React style useState with vue3.
// not working
type SetFunction<T> = (newState: T | ((oldState: T) => T)) => void
export const useState = <T>(initial: T): [T, SetFunction<T>] => {
const state = ref(initial)
const setState: SetFunction<T> = (newState) => {
// @ts-ignore
state.value = typeof newState === 'function' ? newState(state.value) : newState
@mathieutu
mathieutu / Model.php
Created September 1, 2020 14:19
Laravel base Model
<?php
namespace App\Models;
use Illuminate\Support\Str;
use MathieuTu\Exporter\Exporter;
abstract class Model extends \Illuminate\Database\Eloquent\Model
{
use HasUuid, Exporter;