Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
@silentworks
silentworks / slim1.php
Created November 2, 2012 17:17 — forked from alanpich/slim1.php
SlimPHP optional path params
/*@var $controllers Array of String */
/**
* Set up Slim listeners for each controller
*/
foreach($controllers as $C){
// Map GET
$slim->get("/$C/:id(/:relation)",function($id,$relation=null){
print_r(array(
@silentworks
silentworks / _instructions.md
Created November 13, 2012 11:59 — forked from dhrrgn/_instructions.md
A Sublime Text 2 Project file for Fuel

Sublime Text 2 Fuel Project File

Description

This sets up your Sublime Text 2 Fuel project so that your tab and line ending settings are all correct. This way if you like spaces or something, you can still use them by default.

Usage

  1. Create a file named fuel.sublime-project in your Fuel root directory (not the web root).
  2. Open with Sublime Text 2
@silentworks
silentworks / modMigrate.php
Created November 28, 2012 10:24 — forked from alanpich/modMigrate.php
modMigrate ideas
<?php
abstract class pmsMigrateObject {
/* @var object Object Properties */
private $data;
/* @var string MODx Class Name */
private $classKey;
<?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.');
}
'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({
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
<?php
use AlanPich\Configurator;
use AlanPich\Configurator\FileTypeAdapter;
$PROJECT_ROOT = dirname(__FILE__);
define('ENVIRONMENT', 'development');
///////////////////////////////////////////////////////////////////////////////
<?php
/*
* This file is part of the MODSlim package.
*
* Copyright (c) Jason Coward <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@silentworks
silentworks / README.md
Created April 2, 2016 15:50 — forked from pablobm/README.md
A clear convention for a CRUD with standard Ember + Ember Data

CRUD with Ember (+ Data)

Ember's official documentation describes a number of low-level APIs, but doesn't offer advice on how to put them together. As a result, a simple task such as creating a simple CRUD application is not obvious to a newcomer.

To help solving this problem, I decided to figure out and document a clear convention for simple CRUD apps, using Ember and Ember Data with no third-party add-ons.

<template>
<div id="app">
<img class="logo" src="./assets/logo.png">
<Hello></Hello>
<Messages></Messages>
</div>
</template>
<script>
import Hello from './components/Hello'