Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
@silentworks
silentworks / extensions.yml
Created April 6, 2014 09:26
This is my extensions.sls file
include:
- php.apc
- php.curl
- php.fpm
- php.gd
- php.imagick
- php.imap
- php.ldap
- php.mbstring
- php.mcrypt
@silentworks
silentworks / php.yaml
Created April 6, 2014 09:27
My php.sls
php5_ppa:
pkgrepo.managed:
- ppa: ondrej/php5
php5-fpm:
pkg.latest:
- refresh: True
- require:
- pkgrepo: php5_ppa
service.running:
----------
ID: php5-fpm
Function: service.running
Result: False
Comment: The following requisites were not found:
watch:
file: /etc/php5/fpm/pool.d/www.conf
Changes:
- app
- bootstrap
- public
- index.php
- assets
- src
- less
- dist
- vendor
- server.php
@silentworks
silentworks / Router.php
Created April 11, 2014 15:05
Get Slim protected routes out in a public function
<?php
namespace App\Vendor;
class Router extends \Slim\Router
{
/**
* Get all the defined routes
* @return array
*/
public function getRoutes()
<?php
namespace App\Vendor;
use Zend\Permissions\Acl\Acl as ZendAcl;
use Zend\Permissions\Acl\Role\GenericRole as Role;
use Zend\Permissions\Acl\Resource\GenericResource as Resource;
/**
* Class Acl
* @package App\Vendor
@silentworks
silentworks / gulpfile.js
Created May 9, 2014 11:38
Gulp with connect and livereload
var gulp = require('gulp');
var connect = require('connect');
var livereload = require('gulp-livereload');
var shell = require('gulp-shell');
var sass = require('gulp-sass');
var env = process.env.NODE_ENV || 'development';
var port = process.env.PORT || 9008;
var paths = {
<?php
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\Event;
$dispatcher = new EventDispatcher();
$dispatcher->addListener('render', function (Event $event) use ($app) {
$app->render($event['view'], $event['data']);
});
<?php
class TweetController extends \BaseController
{
protected $tweet;
public function __construct($tweet)
{
/* How do I access $app['tweet'] in this controller?
* without using App::make
// Get all required dependencies
// Run Modernizr on our page
require('imports?this=>window!../bower_components/modernizr/modernizr');
// Foundation
var foundation = require('../bower_components/foundation/js/foundation');
// FlightJS