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 fastapi import Request, Depends, HTTPException, Response | |
| from fastapi.responses import RedirectResponse | |
| # This must be randomly generated | |
| RANDON_SESSION_ID = "iskksioskassyidd" | |
| # This must be a lookup on user database | |
| USER_CORRECT = ("admin", "admin") | |
| # This must be Redis, Memcached, SQLite, KV, etc... |
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
| version: "3.8" | |
| services: | |
| # MySQL Database | |
| mysql: | |
| image: mysql:8.0 | |
| command: --default-authentication-plugin=mysql_native_password | |
| restart: always | |
| environment: |
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
| .renovate-template: | |
| variables: | |
| RENOVATE_GIT_AUTHOR: "${GITLAB_USER_NAME} <${GITLAB_USER_EMAIL}>" | |
| RENOVATE_DRY_RUN: "false" | |
| RENOVATE_LOG_LEVEL: "info" | |
| image: | |
| name: node:12 | |
| entrypoint: [""] | |
| only: | |
| - schedules |
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 | |
| // Register these inside a service provider: | |
| Blade::directive('route', function ($expression) { | |
| return "<?php echo route({$expression}) ?>"; | |
| }); | |
| Blade::directive('routeIs', function ($expression) { | |
| return "<?php if (request()->routeIs({$expression})) : ?>"; |
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 | |
| # Please give credit to: https://gist.github.com/matthewmccullough/988077 | |
| # and to: https://gist.github.com/matthewmccullough/988077#gistcomment-2928496 | |
| # Go there and give a star there and not here. | |
| # This is only a copy and paste for personal purposes | |
| gitk --all $(git reflog --format=format:%h) |
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 | |
| #pulls all docker images you have locally | |
| docker images | tr -s ' ' | cut -d " " -f 1,2 | tr ' ' ':' | tail -n +2 | grep -v none | xargs -L1 docker pull |
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 | |
| # cat all access log | |
| # take the url without query params (?param=value) | |
| # group count and sort | |
| zcat ssl_access.log.*.gz | cut -d'"' -f2 | cut -d' ' -f2 | cut -d'?' -f1 | sort | uniq -c | sort -g |
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 PhpCsFixer\Config; | |
| use PhpCsFixer\Finder; | |
| $rules = [ | |
| 'array_indentation' => true, | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => [ | |
| 'default' => 'single_space', |
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 | |
| /** | |
| * Original: https://github.com/morrislaptop/laravel-query-builder-dump/blob/master/src/QueryBuilderDumpServiceProvider.php | |
| */ | |
| if (app()->environment() != 'production') { | |
| \DB::listen(function ($executed) { | |
| $flat = \Arr::flatten($executed->bindings); | |
| foreach ($flat as $binding) { |
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 | |
| #search recursive and syntax check | |
| find . -type f -name '*.php' -not -path "./vendor/*" -exec php -l {} \; |
NewerOlder