Skip to content

Instantly share code, notes, and snippets.

View lmammino's full-sized avatar
🦁
Roar!

Luciano Mammino lmammino

🦁
Roar!
View GitHub Profile
@lmammino
lmammino / gen_uuid.php
Created January 31, 2014 12:06
Create unique ids with Php
<?php
function gen_uuid($len=8) {
$hex = md5("yourSaltHere" . uniqid("", true));
$pack = pack('H*', $hex);
$tmp = base64_encode($pack);
$uid = preg_replace("#(*UTF8)[^A-Za-z0-9]#", "", $tmp);
@lmammino
lmammino / Uid.php
Created February 21, 2014 14:55
UidGenerator Class
<?php
namespace LMammino\Generator;
class Uid
{
/**
* @var string
*/
protected $salt;
@lmammino
lmammino / composer.json
Last active August 29, 2015 13:57
Multi curl tests for kriswallsmith/Buzz (ref: https://github.com/kriswallsmith/Buzz/issues/146)
{
"name": "example/multicurl",
"description": "a test with various multi curl libraries",
"require": {
"kriswallsmith/buzz": "dev-master",
"rdlowrey/artax": "dev-master",
"jyggen/curl": "dev-master"
},
"license": "MIT",
"authors": [
@lmammino
lmammino / Recovery.md
Created March 17, 2014 17:18
Recover Mysql root password

1. Stopping the mysql daemon

/etc/init.d/mysql stopRun

2. Disable security checks and restart mysql

mysqld_safe --skip-grant-tables &amp;
<?php
namespace Sbaam\Bundle\InviteBundle\Http;
use Symfony\Component\HttpFoundation\Response;
/**
* Class BlankPixelResponse
* @package Sbaam\Bundle\InviteBundle\Http

Keybase proof

I hereby claim:

  • I am lmammino on github.
  • I am loige (https://keybase.io/loige) on keybase.
  • I have a public key whose fingerprint is 4553 AB20 F73B B53A 0159 BE56 FBA0 823A 8E8D 6234

To claim this, I am signing this object:

<?php
namespace Oinm\ServiceBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
@lmammino
lmammino / UserManager.php
Created September 4, 2011 16:10 — forked from stof/UserManager.php
Logging in by email or username with FOSUserBundle_FIXED
<?php
namespace Acme\UserBundle\Model;
use FOS\UserBundle\Entity\UserManager as BaseUserManager;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
class UserManager extends BaseUserManager
{
public function loadUserByUsername($username)
@lmammino
lmammino / RackspaceAuthenticationCommand.php
Last active December 14, 2015 03:59
Symfony2 command to test rackspace authentication
<?php
namespace Sbaam\Bundle\UtilsBundle\Command;
use Symfony\Component\Console\Command\Command,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Input\InputOption,
Symfony\Component\Console\Output\OutputInterface;