Skip to content

Instantly share code, notes, and snippets.

@tystr
tystr / deploy.rb
Created February 21, 2013 22:20
Clearing APC cache when deploying a symfony2 application
# Clear APC caches
after "deploy:finalize_update" do
pretty_print "--> Clearing APC caches"
run "cd #{release_path} && php app/console apc:clear --env=prod"
puts_ok
end
@johnkary
johnkary / symfony-live-2013-portland.md
Last active December 17, 2015 15:29
Slides from Symfony Live 2013 - Portland
@yosymfony
yosymfony / index.php
Last active December 19, 2015 09:49
Simple skeleton for Silex application
<?php
require_once __dir__.'/vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Simple skeleton for Silex
*
* Run in PHP >=5.4: $ php -S localhost:8080 -t web web/index.php
@merk
merk / UserController.php
Last active December 22, 2015 08:19
User View Model
<?php
/**
* This file is part of the Project
*
* (c) Infinite Networks Pty Ltd <http://www.infinite.net.au>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@yosymfony
yosymfony / TwigFactory.php
Last active December 22, 2015 18:09
A Twig factory
<?php
require_once '/path/to/lib/Twig/Autoloader.php';
/**
* A factory for create Twig instances
*
* @author Victor Puertas <vpgugr@gmail.com>
*
* Usage:
* <code>
// Datos view Template
$data=array(
//...
);
//Load lib
require_once'libs/Twig/Autoloader.php';
Twig_Autoloader::register();
//config path template
@wadmiraal
wadmiraal / gist:7532480
Created November 18, 2013 18:08
One useful use of override_function.
override_function('override_function', '$function_name, $function_args, $function_code', 'return override_function($function_name, $function_args, $function_code );');
@igorw
igorw / README.md
Created December 17, 2013 16:18
Using laravel 4.1 CookieGuard middleware with silex.

Encrypted Cookies

This is an example of using laravel 4.1 CookieGuard middleware with silex. This demonstrates the composability of stack middlewares.

All of the outgoing cookies are encrypted. If decryption of incoming cookies fails, the application will ignore them.

Installation

Just clone the gist and install the dependencies via composer.

@chris-hall-hu
chris-hall-hu / sql.sql
Created January 2, 2016 08:45
Example sql migration for late Beta Drupal 8 to 8.01
-- Commands run whilst in the new database, the original datbase is call 'old'
-- NOTE this is an example original table etc. will need to be investigate with describe etc.
INSERT INTO taxonomy_index SELECT * FROM old.taxonomy_index;
INSERT INTO taxonomy_term_data SELECT * FROM old.taxonomy_term_data;
INSERT INTO taxonomy_term_field_data SELECT * FROM old.taxonomy_term_field_data;
INSERT INTO taxonomy_term_hierarchy SELECT * FROM old.taxonomy_term_hierarchy;
INSERT INTO node SELECT nid, vid, type, uuid, 'en' FROM old.node;
INSERT INTO node__body SELECT * FROM old.node__body;
@mikeyp
mikeyp / search.sh
Last active September 16, 2016 16:07
BOOM
ag "$@" | peco | awk -F ':' '{print $1 ":" $2}' | xargs pstorm