Skip to content

Instantly share code, notes, and snippets.

View leknoppix's full-sized avatar
🎯
Focusing

Pascal Cañadas leknoppix

🎯
Focusing
View GitHub Profile
.PHONY: help
## === 🆘 HELP ==================================================
help: ## Show this help.
@echo "Laravel Makefile"
@echo "---------------------------"
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@grep -E '(^[a-zA-Z0-9_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
#---------------------------------------------#
@leknoppix
leknoppix / remove-all-from-docker.sh
Created December 23, 2021 18:55 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@leknoppix
leknoppix / docker-compose.yml
Created November 15, 2021 22:26
Try owncloud docker local
version: "3"
services:
app:
container_name: app-server
image: owncloud/server
stdin_open: true
tty: true
expose:
- "80"
- "8080"
<?php
namespace App\Controller;
use App\Controller\AppController;
use App\Form\ContactForm;
class ContactsController extends AppController
{
public function index()
@leknoppix
leknoppix / src_Controller_ContactsController.php
Last active May 10, 2017 19:19
Envoie Email via CakePhp 3
<?php
namespace App\Controller;
use App\Controller\AppController;
use App\Form\ContactForm;
class ContactsController extends AppController
{
public function index()
{
#!/bin/sh
# Script de sauvegarde incrementale du repertoire /original sur la machine serveur
# Ce script utilise l'outil de synchronisation rsync pour faire une image
# globale du repertoire /original de la machine serveur dans le repertoire
# /copie/main/ de la machine client.
# Les sauvegardes incrementales journalieres sont dans chacun
# des repertoires identifies par la date dans le repertoire
# /copie/old_data. Par exemple, le repertoire
# 2004-11-25 contiendra les valeurs des fichiers a ce jour qui seront
# recuperables.
@leknoppix
leknoppix / docker-composer.yml
Created April 27, 2016 16:25
Docker nginx php-fpm mysql phpmyadmin
php:
image: jprjr/php-fpm
volumes:
- www:/srv/http
ports:
- 9000:9000
links:
- db:db
- maildev:maildev
nginx:
@leknoppix
leknoppix / script.sh
Created April 7, 2016 09:51
Script de connexion automatique réseau renater
cd /home
rm -f /home/vide.gif
wget http://www.monsite.fr/pics/vide.gif --tries=1 --timeout=5 --quiet
if [ ! -r /home/vide.gif ] ; then
wget http://www.monsite.fr/pics/vide.gif --http-user=IDENTIFIANT --http-passwd=PASSWORD --tries=1 --quiet
if [ ! -r /home/vide.gif ] ; then
echo "Connection down!!"
beep -f 4000 -l 250 -r 3
else
echo "Connection relancee"
@leknoppix
leknoppix / 0_reuse_code.js
Created January 18, 2016 18:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@leknoppix
leknoppix / main.js
Created November 30, 2015 14:20
Protection js des photos
$(function() {
$("body").delegate('img', 'dragstart', function(e){ e.preventDefault(); });
$("body").delegate('img', 'contextmenu', function(e){ e.preventDefault(); });
$("img").on('contextmenu',function(e){ e.preventDefault() });
$("img").on('dragstart',function(e){ e.preventDefault() });
});