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 | |
public static function fqcnFromPath(string $path): string | |
{ | |
$namespace = $class = $buffer = ''; | |
$handle = fopen($path, 'r'); | |
while (!feof($handle)) { | |
$buffer .= fread($handle, 512); |
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
trait AdvancedSharing | |
{ | |
/** | |
* Modifies a model query to ensure that the authed user is allowed to see this entity. | |
* | |
* @param Builder $query | |
* @param VisibleTo $visibleTo | |
* @return Builder | |
*/ | |
public function scopeVisibleTo(Builder $query, VisibleTo $visibleTo): Builder |
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
dfgdfgdfg |
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 Sparky\PhpSdk\Sparky; | |
$folder = Sparky::folder($folderHash); | |
echo $folder->asset('avatar.jpg')->flipVertical()->maxWidth(500)->url(); |
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
files: | |
"/etc/cron.d/scheduler": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
#* * * * * root docker run --rm -v /var/app/current:/var/www/html 132274109557.dkr.ecr.eu-west-1.amazonaws.com/yourproject/artisan:latest schedule:run >> /dev/null 2>&1 | |
container_commands: | |
001-uncomment-cron: |
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
docker build -t yourproject/artisan . | |
docker tag yourproject/artisan:latest 132274109557.dkr.ecr.eu-west-1.amazonaws.com/yourproject/artisan:latest | |
docker push 132274109557.dkr.ecr.eu-west-1.amazonaws.com/yourproject/artisan:latest |
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
FROM php:7.1-cli | |
RUN apt-get update && apt-get install -y libmcrypt-dev | |
RUN docker-php-ext-install pdo_mysql mbstring mcrypt | |
RUN usermod -u 1000 www-data | |
WORKDIR /var/www/html | |
ENTRYPOINT ["php", "artisan"] |
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
Table create query: | |
CREATE TABLE `records` ( | |
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | |
`number` int(11) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=1000002 DEFAULT CHARSET=utf8; | |
Filled the table with one million rows, with `number` being a random integer between 0 and 100. |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC+rMuk1BHGQiZm8wFdguFhWkvg7MOe5GdaRA1V7GxX13x/CsLaP6ekXxhTqxJzVBg/TLhLVLseqUN32vpA/r44jlYBwV4KGvIW4TFQeDf6a6S8rty33+J3NpPhBBEQMXmFlAHG4UmFZbiaSgK/PFyxmrHcffiryeyqOTyWyNzKafVyCy40lWgLv+WbxeKvquOSqvVdoUpyC1rhGJYEpwNPp5Ed22/naHOVte7B4ByNtK/m3Ghg1NEpMRv8Rwo53PpkxmpDP/7WJYatl/pQ2UxJDbzuJNEZFcOm1RQ4rvRGEXO/mo+fXu+sEpEWWvufyQf293NOSni4GILErmnqClveuoyiVxgkduI2W1vbjdIuva0LYnfgLSGYXw6Dy32aJ78Rd+RSdjcEAIXEotJ9e9ItXd08H81JgthI7CD3nyOKmLva/aUAGE0ZwpOohR7ib4Xe12EDtryMq2JIYxWcOsZ9MA2Eevew0IqeS+y8bRJshWc36OFenDI6CMkguMngWghytcYt8zMvkKQ1Mkf2hLCk8aQ28fhEZ5mecNnuNfspdVtnqwsPJXXC6j1zFin0CfmC1mfR8dR2wg3HphQWeUV7TArEHLf6TMz0nKY7hgu3feICamMHJKZrNqkEf164OA6ypo2smnxA1vO6c9g31n/VwiibbczffmHlQjHO2Lrmvw== cwhite@ESPC-01485 |
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\Polylines; | |
class PathCleaner | |
{ | |
/** | |
* Cleans up the polyline's path by trying to remove any incorrect path points. | |
* | |
* @param $path |
NewerOlder