Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
'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
// Silex Style Controllers
class App extends \Slim\Slim
{
public function mount($controller)
{
if (! is_object($controller)) {
throw new \InvalidArgumentException('Controller must be an object.');
}
@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;
@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 / 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 / CI_phpStorm.php
Created May 23, 2012 10:17 — forked from topdown/CI_phpStorm.php
Code Completion for CodeIgniter in phpStorm
<?php die('This file is not really here!');
/**
* ------------- DO NOT UPLOAD THIS FILE TO LIVE SERVER ---------------------
*
* Implements code completion for CodeIgniter in phpStorm
* phpStorm indexes all class constructs, so if this file is in the project it will be loaded.
* -------------------------------------------------------------------
* Drop the following file into a CI project in phpStorm
* You can put it in the project root and phpStorm will load it.
@silentworks
silentworks / snippet.php
Created May 23, 2012 09:32 — forked from Mark-H/snippet.php
MODX Snippet to take a database backup and to email that.
<?php
$mailto = (isset($mailto)) ? $mailto : '@@ DEFAULT EMAIL HERE @@';
$warningMail = '@@ EMAIL TO SEND WARNING TO IN CASE OF A SMALL BACKUP FILE @@';
include MODX_CORE_PATH.'/config/'.MODX_CONFIG_KEY.'.inc.php';
$host = $database_server; // database host
$dbuser = $database_user; // database user name
$dbpswd = $database_password; // database password
$mysqldb = $dbase; // name of database
@silentworks
silentworks / _more.scss
Created June 30, 2011 14:26 — forked from idan/_more.scss
More is Less
$less-column-width: 68px;
$less-gutter-width: 24px;
@function column-width($columns) {
@return ($less-column-width * $columns) + ($less-gutter-width * ($columns - 1));
}
@function grid-padding-px($columns) {
@if $columns == 10 {
@return 48px;
$data = array(
'first_name' => $this->form_validation->error('first_name'),
'last_name' => $this->form_validation->error('last_name'),
'country' => $this->form_validation->error('country'),
'region' => $this->form_validation->error('region'),
'email' => $this->form_validation->error('email'),
'email_confirm' => $this->form_validation->error('email_confirm'),
'dob_day' => $this->form_validation->error('dob_day'),
'dob_month' => $this->form_validation->error('dob_month'),