Skip to content

Instantly share code, notes, and snippets.

View adrienlucas's full-sized avatar

Adrien LUCAS adrienlucas

View GitHub Profile
adrienlucas / .gitignore
Last active December 25, 2015 20:49
Symfony2 capable gitignore file.
# Deprecated, use gibo instead :
adrienlucas / HackableObject.php
Created November 19, 2013 13:38
Dumb class that can be used to debug a third-party object calls.
class HackableObject {
protected $obj;
public function __construct($obj){
$this->obj = $obj;
adrienlucas / functions.php
Last active August 29, 2015 13:57
Wordpress (quick n' dirty) shortcode to display a map and markers.
This shortcode display a google map with some markers on it.
<!--Usage :-->
Somewhere###<strong></strong><br /><a href=""###-25.363882,174.044922
Somewhere else###<strong></strong><br /><a href=""###15.549876,131.123489
adrienlucas / README
Last active August 29, 2015 14:02
Atom.deb - Debian Jessie
Debian: jessie/sid
Atom: 103
Node: v0.10.28
npm: v1.4.4
adrienlucas / .bash_aliases
Last active August 29, 2015 14:05
My bash resources
alias vgrt-up='(cd vagrant && vagrant up)'
alias vgrt-ssh='(cd vagrant && vagrant ssh)'
alias vgrt-status='(cd vagrant && vagrant status)'
alias vgrt-halt='(cd vagrant && vagrant halt)'
alias ssh-dev='ssh root@'
alias mount-dev='sshfs root@ /mnt/dev'
adrienlucas / pagebrowser.html.twig
Created September 4, 2014 09:11
Twig macro to display a pagination, aka page browser.
Twig macro to display a pagination, aka page browser.
Usage :
First you have to import the macro using "import" :
{% from 'AcmeBundle:Default:Macro/pagebrowser.html.twig' import pagebrowser %}
Then, call the function :
{{ pagebrowser(route, routeParams, totalPages, currentPage, browserSize) }}
Where :
route : the list route that have the page param, usually 'app.request.attributes.get('_route')'
adrienlucas /
Created May 4, 2015 17:11
Bash colors PoC script
echo ---BG---40---41---42---43---44---45---46---47
for i in {30..37} # foreground
echo -n -e FG$i-
for j in {40..47} # background
echo -n -e '\E['$i';'$j'm foo\E[0m'
adrienlucas / .xprofile
Created May 4, 2015 17:13
Disable touchscreen with .xprofile
xinput disable `xinput list | grep "Touchscreen" | sed -E 's/^.*id=([0-9]+).*$/\1/'`
We couldn’t find that file to show.
adrienlucas / true_rand.php
Created March 3, 2016 13:44
True Random in PHP
* Generate a true random integer.
* To be used as a rand() replacement as it behave exactly the same.
* int true_rand(void)
* int true_rand(int $min, int $max)
* It uses the HotBits webservice from FourmilLab as randomness provider
* based on radioactive decay. See