Skip to content

Instantly share code, notes, and snippets.

View hacfi's full-sized avatar

hacfi hacfi

  • Certified Symfony developer
  • Europe
  • X @hacfi
View GitHub Profile
@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 / 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 / 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 / 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 / sudoers
Created March 5, 2016 14:25
OS X sudoers for allowing Vagrant with vagrant-hostmanager plugin - /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
@hacfi
hacfi / activiti.sh
Created July 24, 2016 00:10
Docker run Activiti & Camunda
docker run --name=mysql -d -e 'DB_NAME=activiti' -e 'DB_USER=activiti' -e 'DB_PASS=password' sameersbn/mysql:latest
docker run --name=activiti --rm -it -p 8080:8080 --link mysql:mysql eternnoir/activiti:latest
# open browser at http://{DOCKERIP}:8080/activiti-explorer/
@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"