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 | |
| /* app/validators.php */ | |
| Validator::extend('alpha_spaces', function($attribute, $value) | |
| { | |
| return preg_match('/^[\pL\s]+$/u', $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
| <?php | |
| // this is the base controller which parses output to HTML/CSV/JSON depending on the format in the URL | |
| use Illuminate\Support\Collection; | |
| class FormatController extends Controller { | |
| protected $fileName = 'export'; | |
| protected $view = 'reports.output'; |
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
| /* | |
| See dev dependencies https://gist.github.com/isimmons/8927890 | |
| Compiles sass to compressed css with autoprefixing | |
| Compiles coffee to javascript | |
| Livereloads on changes to coffee, sass, and blade templates | |
| Runs PHPUnit tests | |
| Watches sass, coffee, blade, and phpunit | |
| Default tasks sass, coffee, phpunit, watch | |
| */ |
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 gulp = require('gulp'), | |
| sys = require('sys'), | |
| ssh2 = require('ssh2'); | |
| gulp.task('phpunit', function() { | |
| var ssh = new ssh2(); | |
| ssh.on('ready', function () { | |
| ssh.exec('cd /vagrant; phpunit', {}, function (err, stream) { | |
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
| // Gulp Requires | |
| var gulp = require('gulp'), | |
| gutil = require('gulp-util'), | |
| uglify = require('gulp-uglify'), | |
| notify = require('gulp-notify'), | |
| sass = require('gulp-sass'), | |
| livereload = require('gulp-livereload'), | |
| rjs = require('gulp-requirejs'); | |
| // Node requires for exec and sys |
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
| require.config({ | |
| baseUrl: '/assets/js', | |
| paths: { | |
| jquery: [ | |
| 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min', | |
| 'vendor/jquery' | |
| ], | |
| slider: 'vendor/slider', | |
| player: 'vendor/player' | |
| } |
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 | |
| /* * ** | |
| * | |
| * This script converts an existing MySQL database to migrations in Laravel 4. | |
| * | |
| * 1. Place this file inside app/controllers/ | |
| * | |
| * 2. In this file, edit the index() method to customize this script to your needs. | |
| * - inside $migrate->ignore(), you pass in an array of table |
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
| # config/routes.rb | |
| resources :documents do | |
| scope module: 'documents' do | |
| resources :versions do | |
| post :restore, on: :member | |
| end | |
| resource :lock | |
| end | |
| end |
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
| extension Array { | |
| func first() -> Element? { | |
| if isEmpty { | |
| return nil | |
| } | |
| return self[0] | |
| } | |
| func last() -> Element? { |
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
| <html> | |
| <head> | |
| <title>Select styles with CSS only</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <style> | |
| body { | |
| background-color: #fff; | |
| font-family: helvetica, sans-serif; | |
| margin: 4% 10% | |
| } |