Skip to content

Instantly share code, notes, and snippets.

@BenjaminVillatte
BenjaminVillatte / Makefile
Created May 15, 2022 22:12
Base Makefile for symfony project
.DEFAULT_GOAL = help
# Executables
PHP = php
COMPOSER = composer
YARN = yarn
SYMFONY = symfony
DC = docker-compose -f docker-compose.yml -f docker-compose.override.yml
@BenjaminVillatte
BenjaminVillatte / Makefile
Created October 24, 2021 22:07
Starter Makefile with The help
.DEFAULT_GOAL = help
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
@BenjaminVillatte
BenjaminVillatte / SwitchControl.vue
Created June 8, 2021 09:38
Vuejs SwitchControl
<template>
<div class="switch-control" v-bind="$attrs">
<div class="text off" :class="{ current: !checked }">{{ off }}</div>
<label class="switch">
<input type="checkbox"
value="1"
v-model="checked"
@change="onChange" />
<span class="slider"></span>
</label>
@BenjaminVillatte
BenjaminVillatte / jquery.pluginName.js
Created November 13, 2017 17:23
boilerplate for jquery plugin
(function($) {
$.pluginName = function(element, options) {
var defaults = {
foo: 'bar',
onFoo: function() {}
}
var plugin = this;
@BenjaminVillatte
BenjaminVillatte / gist:c867d7ff434bd54b73ad
Last active March 17, 2016 03:24
truncat mysql table ignoring foreign_key constraints
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;