Skip to content

Instantly share code, notes, and snippets.

View KABBOUCHI's full-sized avatar
🎯
Focusing

Georges KABBOUCHI KABBOUCHI

🎯
Focusing
View GitHub Profile
@wooooodward
wooooodward / axios.js
Created November 6, 2019 17:16
Axios plugin example with request interceptor that adds JWT token to the auth header and 401 response interceptor to refresh token
import Vue from 'vue'
import axios from 'axios'
import store from '../store'
import { TokenService } from '../services/storage.service'
// Full config: https://github.com/axios/axios#request-config
let config = {
baseURL:
process.env.baseURL ||
@reinink
reinink / DateInput.vue
Created August 27, 2019 11:51
Pikaday Vue Component
<template>
<div>
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label>
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change">
<div v-if="error" class="form-error">{{ error }}</div>
</div>
</template>
<script>
import pikaday from 'pikaday'
@KABBOUCHI
KABBOUCHI / canDryRun.php
Last active August 20, 2020 16:45
Dry Run Laravel Form Requests
<?php
namespace App\Http\Requests;
trait canDryRun
{
/**
* Validate the class instance.
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active March 29, 2025 12:18
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@KABBOUCHI
KABBOUCHI / UploadedFileServiceProvider.php
Last active September 21, 2022 21:29
Laravel UploadedFile macro for image manipulation using Intervention Image
<?php
namespace App\Providers;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Intervention\Image\Facades\Image;
@metal3d
metal3d / dlblender
Created September 8, 2018 16:17
Download latest Blender builds
#!/bin/env python3
# -*- encoding: utf8 -*-
"""
Download latest build for Blender 2.7x and 2.8x
How to use:
- get that source code and name it "dlblender"
- change vars INSTALL_PATH and LINK_PATH is you want
- INSTALL_PATH is where will reside new and old version of blender.
I'm using hidden path "~/.blender"
@msklywenn
msklywenn / BatchBuilderSettings.cs
Last active May 18, 2022 14:32
Unity Batch Builder
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
// Version 2, December 2004
//
// Copyright (C) 2004 Sam Hocevar <[email protected]>
//
// Everyone is permitted to copy and distribute verbatim or modified
// copies of this license document, and changing it is allowed as long
// as the name is changed.
//
// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@pissang
pissang / echarts-svg.js
Last active August 23, 2024 03:34
Server side SVG rendering of ECharts
const echarts = require("echarts");
const Canvas = require('canvas');
const {JSDOM} = require('jsdom');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return new Canvas(100, 100);
});
const {window} = new JSDOM();
global.window = window;
<template>
<form @submit.prevent="onSubmit">
<b-field label="Email"
:message="formErrors.first('email')"
:type="formErrors.has('email') ? 'is-warning' : ''">
<b-input type="email"
name="email"
@input="clearErrors"
v-model="formData.email"
v-validate="{required: true, email: true}">
@devSarry
devSarry / Microsoft.PowerShell_profile.ps1
Last active February 28, 2018 10:10
Laravel Powershell Commands -- Place in %UserProfile%\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
function art($arg1,$arg2,$arg3,$arg4,$arg5) { php artisan $arg1 $arg2 $arg3 $arg4 $arg5}
function migrate () {
art migrate
}
function migrate:r () {
php artisan migrate:refresh; php artisan migrate --seed
}
function c:i () {