Skip to content

Instantly share code, notes, and snippets.

View hacfi's full-sized avatar

hacfi hacfi

  • Certified Symfony developer
  • Europe
View GitHub Profile
@hacfi
hacfi / my.cnf
Created February 16, 2013 21:12
my.cnf for mysql/percona on os x installed with brew
[mysql]
port = 3306
socket = /usr/local/var/run/mysql.sock
[mysqld]
#user = mysql
default_storage_engine = InnoDB
socket = /usr/local/var/run/mysql.sock
pid_file = /usr/local/var/run/mysql.pid
<?php
namespace hacfi\AppBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory;
@hacfi
hacfi / keybase.md
Created August 18, 2014 11:43
keybase.md

Keybase proof

I hereby claim:

  • I am hacfi on github.
  • I am hacfi (https://keybase.io/hacfi) on keybase.
  • I have a public key whose fingerprint is 50D1 D63E BDC1 5A42 8C55 2286 1A60 0CC2 51E0 3A30

To claim this, I am signing this object:

@hacfi
hacfi / token_constants.php
Created May 9, 2015 06:09
PHP Token Constants List
<?php
$tokenConstants = array_filter(
get_defined_constants(),
function ($value, $key) {
return substr($key, 0, 2) === 'T_';
},
ARRAY_FILTER_USE_BOTH
);
@hacfi
hacfi / php7_osx.sh
Created May 14, 2015 22:40
Compile PHP7/master on OS X
!#/bin/bash
mkdir -p /usr/local/src/php-src
curl -L https://github.com/php/php-src/archive/master.tar.gz | tar -xzv -C /usr/local/src/php-src --strip-components=1
mkdir /usr/local/src/php-src/ext/ast
curl -L https://github.com/nikic/php-ast/archive/master.tar.gz | tar -xzv -C /usr/local/src/php-src/ext/ast --strip-components=1
cd /usr/local/src/php-src/
@hacfi
hacfi / app AppKernel.php
Created May 19, 2015 20:08
Public Symfony container service methods and nicer names
<?php
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use hacfi\NiceServiceContainer\PhpDumper;
class AppKernel extends AbstractKernel
/*
* smartscroll: debounced scroll event for jQuery *
* based on smartresize by @louis_remi: https://github.com/lrbabe/jquery.smartresize.js *
* Copyright 2011 Louis-Remi & lukeshumard * Licensed under the MIT license. *
*/
var event = $.event,
scrollTimeout;
event.special.smartscroll = {
@hacfi
hacfi / github_issues_pjax.js
Created January 25, 2016 16:02
GitHub Issues PJAX pagination
$(function () {
var loadedPages = [];
console.log('Initializing GitHub Issues PJAX...');
function group () {
if (loadedPages.length) {
return;
}
var currentPage = +$('.pagination > .current').text();
@hacfi
hacfi / disable-xdebug.sh
Created February 5, 2016 00:45
OS X homebrew php 5.6 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php56.plist
echo "xdebug disabled"
@hacfi
hacfi / disable-xdebug.sh
Created February 5, 2016 00:53
OS X homebrew php 7.0 enable/disable xdebug extension script
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php70.plist
echo "xdebug disabled"