This file contains 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\Http\Controllers\BaseController; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Hash; | |
use App\Models\User; | |
use Illuminate\Support\Facades\Validator; |
This file contains 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 | |
require_once __DIR__.'/../vendor/autoload.php'; | |
(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables( | |
dirname(__DIR__) | |
))->bootstrap(); | |
date_default_timezone_set(env('APP_TIMEZONE', 'UTC')); |
This file contains 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 | |
return [ | |
'defaults' => [ | |
'guard' => env('AUTH_GUARD', 'api'), | |
'passwords' => 'users', | |
], | |
'guards' => [ |
This file contains 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 | |
STORE_FOLDER="/home/MySQL-Backups" | |
TODAY=$(date +"%Y-%m-%d") | |
DAILY_DELETE_NAME="daily-"`date +"%Y-%m-%d" --date '7 days ago'` | |
WEEKLY_DELETE_NAME="weekly-"`date +"%Y-%m-%d" --date '5 weeks ago'` | |
MONTHLY_DELETE_NAME="monthly-"`date +"%Y-%m-%d" --date '12 months ago'` | |
databases=($(/usr/bin/mysql -Bse "show databases" | grep -i -v "_schema" | grep -i -v "sys" | grep -i -v "mysql")) |
This file contains 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\Passport; | |
use App\User; | |
use Lcobucci\JWT\Builder; | |
use Lcobucci\JWT\Signer\Key; | |
use League\OAuth2\Server\CryptKey; | |
use Lcobucci\JWT\Signer\Rsa\Sha256; | |
use Laravel\Passport\Bridge\AccessToken as BaseToken; |
This file contains 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.5' | |
services: | |
gitlab: | |
image: gitlab/gitlab-ce:latest | |
hostname: www.jamescoyle.net | |
restart: unless-stopped | |
environment: | |
GITLAB_OMNIBUS_CONFIG: | | |
gitlab_rails['gitlab_shell_ssh_port'] = 8822 | |
ports: |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<style> | |
/* Always set the map height explicitly to define the size of the div | |
* element that contains the map. */ | |
#map { |
This file contains 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
function setOrPush(target, val) { | |
var result = val; | |
if (target) { | |
result = [target]; | |
result.push(val); | |
} | |
return result; | |
} |
This file contains 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
/** | |
* It seems link the AuthGuardMiddleware and ClientCredMiddleware are classes of your own? | |
* For now I've done something similar and created my own middleware as well, but as an extension of the CheckClientCredentials middleware from Passport. I've overridden the handle() function and left out the firstparty-check that has been added in the PR. It looks like this now: | |
*/ | |
class CheckAPICredentials extends CheckClientCredentials | |
{ | |
/** | |
* Validate the scopes and token on the incoming request. | |
* |
This file contains 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
class CodeGenerator { | |
public static $baseCharacters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
public static function increment($x, $digits) | |
{ | |
$charList = static::$baseCharacters; | |
// completa cadeia de caracteres com o numero de digitos parametrizados | |
$x = trim($x); | |
if(strlen($x) < $digits) { |