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
| <script> | |
| import * as moment from 'moment-timezone' | |
| export default { | |
| props: { | |
| date: { | |
| required: true, | |
| default: moment().format() | |
| }, | |
| locale: { |
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 | |
| // Add stuff to redis | |
| foreach ($userIds as $uuid) { | |
| $this->indexer->addAtIndex("users", $uuid); | |
| } | |
| // later... retrieve from redis | |
| $userID = "fa5352f9-fa1b-48c9-862d-1cb614cc7ed8"; | |
| $user = $this->indexer->getAtIndex("users", $userID); |
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 | |
| echo "Building data..."; | |
| $data = ""; | |
| for($i = 0; $i < 1500; $i++) | |
| $data .= sha1("H:k - $i - k:H"); | |
| echo "OK! (".strlen($data)." bytes)".PHP_EOL; | |
| $res = []; |
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
| #!/bin/bash | |
| PHP=`which php` | |
| $PHP php-cs-fixer fix app --rules='{"@PSR2":true,"array_indentation": true,"array_syntax": {"syntax":"short"},"no_unused_imports": true,"object_operator_without_whitespace": true,"ordered_class_elements": {"sortAlgorithm": "none"},"ordered_imports": {"sortAlgorithm": "length"}}' |
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 | |
| class Repository | |
| { | |
| public function findAll(): array | |
| { | |
| return $this->connection->project( | |
| sprintf('SELECT * FROM %s', self::TABLE_NAME), | |
| [], | |
| function(array $row): Domain\MyObject { | |
| return Domain\MyObject::fromArray($row); |
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 CONCAT("ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ", | |
| "ALTER TABLE ",TABLE_SCHEMA,".",TABLE_NAME," CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ") | |
| AS alter_sql | |
| FROM information_schema.TABLES | |
| WHERE TABLE_SCHEMA = 'mist'; |
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 | |
| /** | |
| * Trait Guarded | |
| * use in a Laravel FormRequest class | |
| */ | |
| trait Guarded | |
| { | |
| /** | |
| * Get all input parameter that are guarded by and | |
| * match the rules array of the form request |
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
| import { Injectable } from '@angular/core'; | |
| import { Http, Headers, RequestOptions, Response } from '@angular/http'; | |
| import { User } from '../_models/index'; | |
| @Injectable() | |
| export class UserService { | |
| constructor(private http: Http) { } | |
| getAll() { |
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\Console\Commands; | |
| use Illuminate\Routing\Route; | |
| use Illuminate\Foundation\Console\RouteListCommand; | |
| class RouteRBAC extends RouteListCommand | |
| { | |
| /** | |
| * {@inheritdoc} |
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\Console\Commands; | |
| use Illuminate\Routing\Route; | |
| use Illuminate\Foundation\Console\RouteListCommand; | |
| class RouteTable extends RouteListCommand | |
| { | |
| /** | |
| * {@inheritdoc} |