Wash your hands of remembering the command to proxy a url through Browser Sync
Usage:
$ sink localhost:4001
Instead of:
$ browser-sync start --proxy "localhost:4001" --files "css/*.css"
// Sass 3.3 | |
// This function can be used to get the largest number from a nested map. Currently only supports 1 sub-map. | |
// Uses max() to get the biggest number in a map | |
// See max() docs for reference: http://sass-lang.com/documentation/Sass/Script/Functions.html#max-instance_method | |
@function get-max($map, $key) { | |
$list: (); | |
// Loop through each item in the map | |
@each $map-key, $sub-map in $map { |
// Sass 3.3 | |
$example: ( | |
foo: ( | |
x: 100, | |
y: 200 | |
), | |
bar: ( | |
x: 150, | |
y: 250 |
Usage:
$ sink localhost:4001
Instead of:
$ browser-sync start --proxy "localhost:4001" --files "css/*.css"
// Inspired by byhays CSS version https://gist.github.com/bhays | |
.twitter-typeahead .tt-query, | |
.twitter-typeahead .tt-hint { | |
margin-bottom: 0; | |
} | |
.tt-hint { | |
color: #bbb; | |
color: rgba(0, 0, 0, .4); |
// By default, Laravel sets up the routes for auth/ and password/ using implicit controllers | |
Route::controllers([ | |
'auth' => 'Auth\AuthController', | |
'password' => 'Auth\PasswordController', | |
]); | |
// This means to get a url to the route, you need to do something like url('/auth/login') |
<?php | |
namespace Tests; | |
use App\Exceptions\Handler; | |
use Exception; | |
use Illuminate\Contracts\Debug\ExceptionHandler; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
abstract class TestCase extends BaseTestCase |
Sometimes you may run into cases where you would like at least 1 middleware to pass from multiple middlewares.
Laravel cannot do this out of the box, so I created a middleware that proxies other middleware and passes as soon as one passes.
When following TDD you shouldn't be writing any application code without writing a test first. This applies to middleware on routes too, however writing a specific test for every route is time consuming.
I decided to write a single test file that knew which endpoints on my API can and cannot be accessed with valid auth credentials.
Here I'm using Passport's Client Credentials to protect endpoints, but you should be able to tweak this file for any auth method.
This file only consists of 3 tests:
module.exports = function(grunt) { | |
pkg = grunt.file.readJSON('package.json'); | |
require('load-grunt-config')(grunt, pkg); | |
require('load-grunt-tasks')(grunt, pkg); | |
// ... | |
grunt.registerTask('prism', ['concat', 'uglify']); |
<?php | |
namespace App\PostTypes; | |
use Rareloop\Lumberjack\QueryBuilder\Post as LumberjackPost; | |
class Post extends LumberjackPost | |
{ | |
public static function paginate($perPage = 10) | |
{ |