Skip to content

Instantly share code, notes, and snippets.

View notFloran's full-sized avatar

Floran Brutel notFloran

View GitHub Profile
@notFloran
notFloran / reboot_nb6.sh
Last active March 29, 2024 09:22
Script pour redémarrer une Neufbox v6 Infos : NB6-SER-r2 NB6-MAIN-R3.2.12
#!/bin/bash
WEBLOGIN=admin
WEBPASS=
IP=192.168.1.1
wget -qO- http://$IP/login --referer="http://$IP/login?page_ref=/reboot" "http://$IP/reboot" --post-data="method=passwd&zsid=&login=$WEBLOGIN&password=$WEBPASS&submit=" &> /dev/null
@notFloran
notFloran / ApiRender.php
Created November 18, 2018 10:50
Use MJML API with notfloran/mjml-bundle
<?php
# src/Mjml/ApiRenderer.php
namespace App\Mjml;
use Mjml\Client;
use NotFloran\MjmlBundle\Renderer\RendererInterface;
class ApiRenderer implements RendererInterface
@notFloran
notFloran / remove_php.sh
Last active April 26, 2018 09:21
Homebrew - remove PHP and its config
# remove all php and extensions, use "brew list | grep php" to get all packages
brew uninstall --force --ignore-dependencies php71-xdebug php71-amqp php71 ....
# remove all configs
rm -rf /usr/local/etc/php/7.1
rm -rf /usr/local/opt/php@7.1
rm -rf /usr/local/share/pear
rm -rf /usr/local/lib/php/
rm -rf /usr/local/Cellar/php@71
@notFloran
notFloran / LoggerPlugin.php
Created April 4, 2018 19:23
Log all emails sent with Swiftmailer
<?php
namespace App\Swiftmailer;
use Psr\Log\LoggerInterface;
use Swift_Events_SendEvent;
use Swift_Events_SendListener;
class LoggerPlugin implements Swift_Events_SendListener
{
@notFloran
notFloran / create_server.php
Created April 29, 2015 19:29
PHP script to create a server on Runabove with php-opencloud
<?php
require 'vendor/autoload.php';
use OpenCloud\OpenStack;
use Guzzle\Http\Exception\BadResponseException;
$client = new OpenStack('https://auth.runabove.io/v2.0/', array(
'username' => '', // email
'password' => '',
@notFloran
notFloran / SentryExceptionCatcherProcessor.php
Created June 7, 2017 08:50
SentryExceptionCatcherProcessor for Swarrot
<?php
namespace Hexanet\Si\AppBundle\Processor\Swarrot;
use Swarrot\Broker\Message;
use Swarrot\Processor\ProcessorInterface;
class SentryExceptionCatcherProcessor implements ProcessorInterface
{
/**
@notFloran
notFloran / php-amqp.sh
Last active March 26, 2016 21:00
Install amqp extension for php - Debian 7
#!/bin/sh
apt-get install php5-dev make cmake php-pear
git clone git://github.com/alanxz/rabbitmq-c.git && cd rabbitmq-c
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --target install
@notFloran
notFloran / .gitconfig
Created January 21, 2014 20:22
Git : use http when ssh is blocked
[url "http://git.floran.fr/"]
insteadOf = git@git.floran.fr:
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*
@notFloran
notFloran / Homebrew.md
Last active December 23, 2015 04:39 — forked from alanivey/Homebrew.md
Correct command

Prerequisites

Xcode

Go to http://developer.apple.com/downloads, log in with your Apple ID (free) and download the newest version of either Command Line Tools (OS X Lion) for Xcode or Command Line Tools (OS X Mountain Lion) for Xcode. Run the installer in the dmg and you'll have the LLVM compiler, make, and other build tools.

XQuartz

Install XQuarts to satisfy a library dependency for PHP.