Skip to content

Instantly share code, notes, and snippets.

View florentdestremau's full-sized avatar

Florent Destremau florentdestremau

View GitHub Profile
@florentdestremau
florentdestremau / install.sh
Last active September 7, 2018 10:19
Initial setup on a thinkpad X260. Manually installing Chrome and Phpstorm aside. Download and run
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install git zsh tig curl vim htop vlc tlp tlp-rdw build-essential automake
# Battery management
sudo tlp start
# install node js
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
@florentdestremau
florentdestremau / command.php
Created February 17, 2017 13:58
Simple symfony command to read a csv file in project root
<?php
/**
* @param InputInterface $input
* @param OutputInterface $output
*
* @return int|null
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$file = $input->getArgument('file');
@florentdestremau
florentdestremau / button.html
Last active January 4, 2017 11:55
Bootstrap hack to make a Confirm / Cancel button group. See the width: 4% -> 4 times the width of the first one
<div class="btn-group btn-group-justified" role="group">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default btn-lg">
&times;
</button>
</div>
<div class="btn-group" role="group" style="width: 4%;">
<button type="button" class="btn btn-success btn-lg btn-block">
Confirm ?
</button>
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTScrollView.h"
@florentdestremau
florentdestremau / cleanup.sh
Last active June 6, 2016 09:58
Clean up your git branches towards remote
git fetch origin --prune
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@florentdestremau
florentdestremau / .tigrc
Created April 13, 2016 13:29
A simple tig custom config
# In status view, push to origin
bind status P !git push origin
# In status view, pull from origin
bind status L !git pull origin
# In any view, amend current commit
bind generic + !git commit --amend
# In status view, delete selected file
@florentdestremau
florentdestremau / xdebug.ini
Created January 22, 2016 10:16
Xdebug config
zend_extension=/usr/lib/php5/20100525/xdebug.so
[xdebug]
xdebug.cli_color = 1
xdebug.scream = Off
xdebug.max_nesting_level = 500
[xdebug-remote-debug]
xdebug.remote_enable = true
xdebug.remote_autostart = 0
xdebug.remote_mode = req
@florentdestremau
florentdestremau / brightness
Created January 13, 2016 10:56
Manually set the brightness (from 0 to 1 scale). For those like me with an Asus Zenbook and no control over it, you can have a custom shortcut
xrandr --output eDP1 --brightness 0.75
@florentdestremau
florentdestremau / -etc-apache2-apache2.conf
Created October 11, 2015 10:15
PhpMyAdmin problem solving
Include /etc/phpmyadmin/apache.conf
@florentdestremau
florentdestremau / ProjectConfiguration.php
Created September 28, 2015 16:45
Symfony 1 relocate cache dir for vagrant use
<?php
require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');