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\Middleware; | |
use Closure; | |
class Acl | |
{ | |
/** | |
* Handle an 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
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class AuthController extends Controller | |
{ | |
const COOKIE_ACCESS_TOKEN = 'access_token'; | |
const COOKIE_SESSION = 'session'; |
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
import Cookies from 'js-cookie'; | |
const name = 'session'; | |
export default class Session { | |
static get() { | |
if (Cookies.get(name)) { | |
return JSON.parse(Cookies.get(name)); | |
} | |
return { |
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
server { | |
listen 443 ssl; | |
server_name pgn-chess-data.local; | |
ssl_certificate /etc/nginx/ssl/pgn-chess-data.local.crt; | |
ssl_certificate_key /etc/nginx/ssl/pgn-chess-data.local.key; | |
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH; | |
ssl_protocols TLSv1.1 TLSv1.2; | |
root /usr/share/nginx/pgn-chess-data/public; |
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 realpath(dirname(__FILE__)) .'/../src/bootstrap.php'; | |
header("Access-Control-Allow-Origin: *"); | |
header('Access-Control-Allow-Methods: GET, POST'); | |
header("Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"); | |
switch (true) { | |
case '/api/query' === $_SERVER['REQUEST_URI'] && $_SERVER['REQUEST_METHOD'] === 'POST': |
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 Chess\Tests\Unit\Fen; | |
use Chess\Ascii; | |
use Chess\Board; | |
use Chess\PGN\Convert; | |
use Chess\PGN\Symbol; | |
use Chess\Tests\AbstractUnitTestCase; |
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 Chess\Tests\Unit\Fen; | |
use Chess\Ascii; | |
use Chess\Board; | |
use Chess\PGN\Convert; | |
use Chess\PGN\Symbol; | |
use Chess\Tests\AbstractUnitTestCase; | |
use Chess\Tests\Sample\Opening\Benoni\BenkoGambit; |
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 Chess\Tests\Unit\Fen; | |
use Chess\Board; | |
use Chess\FenString;; | |
use Chess\PGN\Convert; | |
use Chess\PGN\Symbol; | |
use Chess\Tests\AbstractUnitTestCase; | |
use Chess\Tests\Sample\Opening\Benoni\BenkoGambit; |
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 Chess\Tests\Unit\Fen; | |
use Chess\Ascii; | |
use Chess\FenBoard;; | |
use Chess\PGN\Convert; | |
use Chess\PGN\Symbol; | |
use Chess\Tests\AbstractUnitTestCase; |