Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
<?php
$input = array_pop(explode('/', $input));
$jobNum = array_shift(explode('_', $input));
return $jobNum;
<?php
// Silex Style Controllers
class App extends \Slim\Slim
{
public function mount($controller)
{
if (! is_object($controller)) {
throw new \InvalidArgumentException('Controller must be an object.');
}
<?php
use \Phpmig\Pimple\Pimple,
\Illuminate\Database\Capsule\Manager as Capsule;
$container = new Pimple();
$container['db'] = $container->share(function() {
return new PDO('dblib:dbname=testdb;host=127.0.0.1','username','passwd');
});
<?php
/**
* Do the migration
*/
public function up()
{
/* @var \Illuminate\Database\Schema\Blueprint $table */
$this->get('schema')->create('posts', function ($table)
{
@silentworks
silentworks / transport.menu.php
Created August 12, 2013 23:29
Preparing menu installer for MODX 2.3
<?php
/**
* Formz
*
* Adds modActions and modMenus into package
*
* @package Formz
* @subpackage build
*/
$modx->getVersionData();
'use strict';
var generateAngularTemplate = require('./../utils/generate-angular-template');
// Adds html tempalate in $templateCache and writes file to destFile
//
// $templateCache key is the filepath passed in as srcFile:
// options.prependPrefix + options.srcFile.replace(stripPrefix, '')
//
// grunt.initConfig({
<?php
$app = new \Slim\Slim();
$app->group('/about', function () use() {
$app->get('/us', function () {
echo "You can access me via /about/us"
});
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
{
"name": "test",
"version": "0.1.0",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
@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