This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\ORM\Query\SqlWalker; | |
/** | |
* Quick hack to allow adding a USE INDEX on the query | |
*/ | |
class UseIndexWalker extends SqlWalker | |
{ | |
const HINT_USE_INDEX = 'UseIndexWalker.UseIndex'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Twig REPL hack | |
* | |
* Arnaud Le Blanc <arnaud.lb@gmail.com> | |
*/ | |
require 'lib/Twig/Autoloader.php'; | |
Twig_Autoloader::register(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 'apprentice_blue.vim' -- Vim color scheme. | |
" Author: Arnaud Le Blanc | |
" Description: Based on the 'apprentice' color scheme | |
" MADE-UP NAME HEX RGB XTERM ANSI | |
" ======================================================================== | |
" almost black #1c1c1c rgb(28, 28, 28) 234 0 | |
" darker grey #262626 rgb(38, 38, 38) 235 background color | |
" dark grey #303030 rgb(48, 48, 48) 236 8 | |
" grey #444444 rgb(68, 68, 68) 238 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function flushQueue() | |
{ | |
$container = $this->getContainer(); | |
$transport = $container->get('mailer')->getTransport(); | |
$spool = $transport->getSpool(); | |
$spool->flushQueue($container->get('swiftmailer.transport.real')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ${1:`substitute(substitute(expand("%:h"), '\v^\w+\/(\u)', '\1', ''), '\/', '\\\', 'g')`}; | |
class ${2:`Filename('', 'myClass')`} | |
{ | |
${3} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ftplugin/php.vim | |
if !exists("*s:JumpToTest") | |
function s:isTestFile() | |
return expand("%s") =~ "/Tests/.*Test.php$" | |
endfunction | |
function s:testFile() | |
if s:isTestFile() | |
return expand("%") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# to use, save this file as .git/hooks/pre-commit in your git repo | |
# make sure to add execute permissions using: chmod +x .git/hooks/pre-commit | |
command -v pngcrush >/dev/null 2>&1 || { | |
echo "\033[1mPlease install pngcrush to reduce images size before commit\033[0m" | |
echo "Install pngcrush with the following:" | |
echo "\t \033[1mbrew install pngcrush\033[0m" | |
echo "OR" | |
echo "\t Site: \033[1m\033[4mhttp://pmt.sourceforge.net/pngcrush/\033[0m" | |
echo "\t Download: \033[1m\033[4mhttp://sourceforge.net/projects/pmt/files/\033[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ -------------------------------------------------- | |
/ when value is false (or null), attr isn't rendered | |
/ -------------------------------------------------- | |
%input(type="checkbox" checked=false) | |
%div(class=(false ? false : "test")) | |
/ <input type="checkbox" /> | |
/ <div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/var/lib/redis/dump.rdb { | |
# rotate every day and keep 30 backups | |
daily | |
rotate 30 | |
missingok | |
# rename backups dump.rdb-YYYYMMDD | |
# instead of dump.rdb.X: more rsync friendly | |
dateext | |
# create a new dump | |
postrotate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\ORM\Event\OnClearEventArgs; | |
use Gedmo\Tool\Wrapper\AbstractWrapper; | |
/** | |
* Register the listener with $em->getEventManager()->addEventListener('onClear', new ClearListener()) | |
*/ | |
class ClearListener | |
{ |
NewerOlder