Skip to content

Instantly share code, notes, and snippets.

View JulienBreux's full-sized avatar

Julien Breux JulienBreux

View GitHub Profile
@JulienBreux
JulienBreux / etc-network-interfaces
Last active August 29, 2015 14:16
Proxmox Master Host
auto vmbr1
iface vmbr1 inet static
address 10.10.10.254
netmask 255.255.255.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
@JulienBreux
JulienBreux / Dockerfile
Created February 10, 2015 07:09
Docker + Rails + Redis + Postgres
# base on latest ruby base image
FROM ruby:latest
# update and install dependencies
RUN apt-get update -qq
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libpq-dev nodejs apt-utils postgresql-client
# setup app folders
RUN mkdir /sample
WORKDIR /sample
@JulienBreux
JulienBreux / PluginAbstract.php
Created August 20, 2014 13:07
Plugin abstract example
<?php
namespace Iadvize\Admin\Plugin;
/**
* Class PluginAbstract
*
* @package Iadvize\Admin\Plugin
*/
abstract class PluginAbstract
@JulienBreux
JulienBreux / README.md
Last active August 29, 2015 14:01
Jira - Epics

How to install?

curl -O https://getcomposer.org/composer.phar
php composer.phar install

How to use?

php -S locahost:8888

@JulienBreux
JulienBreux / gist:10776219
Last active August 29, 2015 13:59
PHP - Error to Exception
<?php
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontex) {
throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
});
@JulienBreux
JulienBreux / index.php
Last active December 26, 2015 08:08
Twilio Test
<?php
// Lib: https://github.com/twilio/twilio-php
require_once __DIR__.'/libs/twilio/Services/Twilio.php';
// Constants
const SID = 'AC...';
const TKN = '...';
const NBR = '+33XXXXXXXXX';
// Variables
@JulienBreux
JulienBreux / crop.php
Created June 19, 2013 12:56
Croping for OpenLayers|OpenStreetMap
#!/usr/bin/php
<?php
$widthTile = 256;
$heightTile = 256;
if (!isset($argv[1]))
{
exit('No input file argument'.PHP_EOL);
}
@JulienBreux
JulienBreux / st2.json
Last active December 18, 2015 16:39
ST2 - Preferences
// Packager: http://wbond.net/sublime_packages/package_control
// Packages: SublimeLinter, Emmet, Git
{
"font_size": 13.0,
"ignored_packages":
[
"Vintage"
],
"highlight_line": true,
"highlight_modified_tabs": true,
@JulienBreux
JulienBreux / gist:5480728
Last active December 16, 2015 18:49
This little script will protect access to dirs. Use like this: /home/<user>/www/fichiers/admin/index.php /home/<user>/www/fichiers/<first-directory>/ /home/<user>/www/fichiers/<second-directory>/
<?php
/////// FUNCTIONS
function removeHtaccess($path, $filename = '.htaccess')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);
}
function removeHtpasswd($path, $filename = '.htpasswd')
{
file_exists($path.DIRECTORY_SEPARATOR.$filename) && unlink($path.DIRECTORY_SEPARATOR.$filename);