Skip to content

Instantly share code, notes, and snippets.

View OwlyCode's full-sized avatar

Tristan Maindron OwlyCode

View GitHub Profile
@OwlyCode
OwlyCode / gist:b880fab7e92fbe55b489b0a3b826281e
Created October 26, 2020 13:30
Total des décès calculés de janvier à septembre selon l'INSEE : https://www.insee.fr/fr/information/4190491
<?php
/**
Téléchargez les données de l'INSEE dans le même dossier que ce script. Renommez deces-2020-m1.csv en Deces_2020_M01.csv
afin de suivre la convention des mois suivants.
Mes résultats :
2018/01 : 60525
2018/02 : 52822
2018/03 : 61074
<?php
namespace App\Entity\Traits;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
trait BlameableTrait
{
@OwlyCode
OwlyCode / got
Created May 3, 2019 10:35
Transforms a missed "git" into a cool GoT quote
#!/bin/bash
set -e
quotes[0]="Nothing isn't better or worse than anything. Nothing is just nothing. - \033[90mArya Stark\033[0m"
quotes[1]="It wasn't for the murder that the Gods cursed the Rat Cook, or for serving the King's son in a pie. He killed a guest beneath his roof. That's something the Gods can't forgive. - \033[90mBran Stark\033[0m"
quotes[2]="A woman's life is nine parts mess to one part magic, you'll learn that soon enough... and the parts that look like magic often turn out to be messiest of all. - \033[33mCersei Lannister\033[0m"
quotes[3]="I am a lioness. I will not cringe for them. - \033[33mCersei Lannister\033[0m"
quotes[4]="Jaime and I are more than brother and sister. We are one person in two bodies. We shared a womb together. He came into this world holding my foot, our old maester said. When he is in me, I feel... whole. - \033[33mCersei Lannister\033[0m"
quotes[5]="Love is poison. A sweet poison, yes, but it will kill you all the same. - \033[33mCersei Lannister\033[0m"
@OwlyCode
OwlyCode / index.php
Created June 16, 2015 19:54
Php error logging to stderr using Docker's official php:5.6-apache image
<?php
use Symfony\Component\Debug\ErrorHandler;
use Symfony\Component\Debug\ExceptionHandler;
require_once __DIR__.'/vendor/autoload.php';
ErrorHandler::register();
$handler = ExceptionHandler::register(false);
@OwlyCode
OwlyCode / behat-launcher.sh
Last active August 29, 2015 13:57
Behat-launcher daemon script
#! /bin/sh
# Based on http://www.bram.us/2013/11/11/run-a-php-script-as-a-servicedaemon-using-start-stop-daemon/
# Put this script into /etc/init.d/
# cp behat-launcher /etc/init.d/behat-launcher
#
# Make it executable :
# chmod 0755 /etc/init.d/behat-launcher
#
@OwlyCode
OwlyCode / gridster.resize-patch.js
Last active June 13, 2017 06:43
Extending Gridster to allow dimensions to be resized. See https://github.com/ducksboard/gridster.js/pull/77
(function($) {
$.Gridster.generate_stylesheet = function(opts) {
var styles = '';
var max_size_x = this.options.max_size_x;
var max_rows = 0;
var max_cols = 0;
var i;
var rules;
opts || (opts = {});