Skip to content

Instantly share code, notes, and snippets.


Adrien LUCAS adrienlucas

View GitHub Profile

Keybase proof

I hereby claim:

  • I am adrienlucas on github.
  • I am adrienlucas ( on keybase.
  • I have a public key ASCu32wHMOVwGIyjYn8HN2oWjHucMDFQuqgzU-cqGpdX3wo

To claim this, I am signing this object:

adrienlucas / thenable.js
Created Jun 12, 2017
jQuery Thenable stacking POC
View thenable.js
import jQuery from 'jquery';
it('stacks several promises with one rejection', () => {
const p1 = new jQuery.Deferred();
const p2 = new jQuery.Deferred();
const p3 = new jQuery.Deferred();
const stack = jQuery.when(...promises);
View true_rand.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
adrienlucas / HackableObject.php
Created Nov 19, 2013
Dumb class that can be used to debug a third-party object calls.
View HackableObject.php
class HackableObject {
protected $obj;
public function __construct($obj){
$this->obj = $obj;
adrienlucas / .gitignore
Last active Dec 25, 2015
Symfony2 capable gitignore file.
View .gitignore
# Deprecated, use gibo instead :
adrienlucas / .xprofile
Created May 4, 2015
Disable touchscreen with .xprofile
View .xprofile
xinput disable `xinput list | grep "Touchscreen" | sed -E 's/^.*id=([0-9]+).*$/\1/'`
We couldn’t find that file to show.
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 / pagebrowser.html.twig
Created Sep 4, 2014
Twig macro to display a pagination, aka page browser.
View pagebrowser.html.twig
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 / .bash_aliases
Last active Aug 29, 2015
My bash resources
View .bash_aliases
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'