This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Console\Command; | |
use Illuminate\Container\Container; | |
class PackageMigrationCommand extends Command | |
{ | |
/** | |
* Name of the command. | |
* | |
* @param string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Defer until needed. | |
*/ | |
public $defer = true; | |
/** | |
* Repositories defined by the users module. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// In model: Ensures values are consistent | |
class User extends Eloquent { | |
public function setEmailAttribute(Email $email) { | |
$this->attributes['email'] = $email; | |
} | |
} | |
// Value object | |
class Email { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ValidationServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Indicates if loading of the provider is deferred. | |
* | |
* @var bool | |
*/ | |
protected $defer = true; | |
public function register() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load all the required plugins. | |
var gulp = require('gulp'), | |
notify = require('gulp-notify'), | |
exec = require('gulp-exec'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
jshint = require('gulp-jshint'), | |
rename = require('gulp-rename'); | |
var input = 'assets/', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Interceptor | |
* Implements functionality to catch various requests and fire events when they happen. This is generally to ensure | |
* that responses from the server are handled in a uniform fashion across the application. Also, by firing events | |
* it allows to have any number of handlers attach to the response. | |
* | |
* @author Kirk Bushell | |
* @date 28th March 2013 | |
*/ | |
var module = angular.module('core.interceptor', []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@servers(['web' => '111.111.111.111']) | |
@task('deploy') | |
cd /var/www | |
git pull origin master | |
composer install | |
php artisan migrate | |
@endtask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var registration = { | |
create: function() { | |
var status = null; | |
var data = { | |
id: '', | |
status: '' | |
}; | |
this.setStatus = function(value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Typeahead directive for fields. Expects both a typeahead and location attribute. | |
* | |
* @param string typeahead - If a value is provided, this should be a two-way data binding to the model that you would like to utilize in partnership with this plugin. | |
* @param string location - Where the data can be found for remote queries. | |
*/ | |
module.directive( 'typeahead', [ '$window', '$timeout', function( $window, $timeout ) { | |
return { | |
restrict: 'A', | |
scope: { model: '=typeahead', value: '@' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var resolver = [ '$q', 'Service', function( $q, Service ) { | |
var deferred = $q.defer(); | |
Service.query({ paginate: false }, function( data ) { | |
deferred.resolve( data ); | |
}, function() { | |
deferred.reject( null ); | |
}); | |
return deferred.promise; |