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 | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Response; | |
| use Illuminate\Cache\RateLimiter; | |
| class ThrottleRequests | |
| { |
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
| select t2.id, t2.name | |
| from ( | |
| select | |
| @r as _id, | |
| (select @r := parent_id from categories where id = _id) as parent_id, | |
| @l := @l + 1 as lvl | |
| from | |
| (select @r := :id, @l := 0) vars, | |
| categories h | |
| where @r <> 0) t1 |
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
| # Commands for setting time on servers | |
| # FOR TESTING PURPOSES ONLY # | |
| # Disable NTP syncing | |
| sudo timedatectl set-ntp 0 | |
| # Set time to when you want | |
| sudo timedatectl set-time "2016-07-01 08:00:00" | |
| # Enable NTP syncing |
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
| # remove all tags from origin that end in digits (/[0-9]*) | |
| # remove --dry-run to actually do the deletions | |
| git ls-remote --tags | grep -o 'refs/tags/.*/[0-9]*' |sort -r |xargs git push --dry-run --delete origin | |
| # sync all remote tags with your local repo so you don't push them all back up to the remote | |
| git fetch --prune origin '+refs/tags/*:refs/tags/*' |
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
| { | |
| "links": { | |
| "self": "http://example.com/articles", | |
| "first": "http://example.com/articles?page=1", | |
| "last": "http://example.com/articles?page=2", | |
| "prev": null, | |
| "next": "http://example.com/articles?page=2" | |
| }, | |
| "data": [ | |
| { |
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
| { | |
| "type": "articles", | |
| "id": "1", | |
| "attributes": { | |
| "title": "JSON API paints my bikeshed!" | |
| }, | |
| "links": { | |
| "self": "http://example.com/api/articles/1" | |
| } | |
| } |
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 | |
| namespace App\Http\Controllers; | |
| use App\Article; | |
| class ArticleController extends Controller | |
| { | |
| /** | |
| * Display the specified resource. |
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
| { | |
| "id": 1, | |
| "title": "JSON API paints my bikeshed!", | |
| } |
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
| { | |
| "links": { | |
| "self": "http://example.com/articles", | |
| "next": "http://example.com/articles?page[offset]=2", | |
| "last": "http://example.com/articles?page[offset]=10" | |
| }, | |
| "data": [{ | |
| "type": "articles", | |
| "id": "1", | |
| "attributes": { |
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\Support\Facades\Schema; | |
| use Illuminate\Database\Schema\Blueprint; | |
| use Illuminate\Database\Migrations\Migration; | |
| class CreatePeopleTable extends Migration | |
| { | |
| /** | |
| * Run the migrations. |