Skip to content

Instantly share code, notes, and snippets.

View Moinax's full-sized avatar
🏠
Working from home

Jérôme Poskin Moinax

🏠
Working from home
View GitHub Profile
@Moinax
Moinax / runCommand.php
Last active December 16, 2015 13:29
Run command in background from Symfony controller
/**
* Call a command in background
*
* @param string $command
* @param array $arguments
*
* @return int
*/
public function runCommand($command, $arguments = array(), $logName = 'tvdb.commands')
{
@Moinax
Moinax / port-uninstall-all
Last active December 18, 2015 02:18
Port uninstall every ports installed
sudo port -fp uninstall installed
@Moinax
Moinax / com.apple.quarantine
Last active December 18, 2015 13:09
Remove apple quarantine xattr
find . | xargs xattr -d com.apple.quarantine
@Moinax
Moinax / Flush DNS
Created August 3, 2013 10:15
Flush DNS on Mac OS X
sudo dscacheutil -flushcache
@Moinax
Moinax / Remove passphrase
Last active December 20, 2015 15:29
Remove passphrase on ssh key
ssh-keygen -p
@Moinax
Moinax / activate xdebug remote phpstorm
Last active December 21, 2015 01:49
Provide a way to connect xdebug through remote server with PHPStorm
export XDEBUG_CONFIG="idekey=PHPSTORM"
@Moinax
Moinax / ClientController.php
Last active August 29, 2015 13:57
Symfony Form validation through api with common model
<?php
namespace Acme\HelloBundle\Controller;
use Guzzle\Http\Client;
use Guzzle\Http\Exception\BadResponseException;
public function someAction()
{
@Moinax
Moinax / biggest_directories.sh
Created March 6, 2014 13:37
Locate biggest directory on debian server
# List the 10 biggest directory in the current directory
sudo du -hsx * | sort -rh | head -10
@Moinax
Moinax / README.md
Created April 17, 2014 12:33 — forked from peteboere/README.md
Avoid `console` errors in browsers that lack a console.
@Moinax
Moinax / Coupon.php
Created June 23, 2014 16:39
Coupon generation
/**
* @return string
*/
protected function generateCode()
{
$length = 8;
$code = "";
$possible = "2346789234567891234567892345678923456789234567892345678923456789234567892345678923456789abcdfghjkmnpqrtvwxyzABCDFGHJKLMNPQRTVWXYZ";
$maxlength = strlen($possible);