Skip to content

Instantly share code, notes, and snippets.

View l0gicgate's full-sized avatar
🏁
Sprinting

Pierre B. l0gicgate

🏁
Sprinting
View GitHub Profile
<?php
namespace Project\Services\Authentication;
// This file should reside in your project root's `src\Services` sub-directory
use Illuminate\Hashing\BcryptHasher;
use Psr\Log\LoggerInterface;
use Project\Repositories\UserRepository;
class AuthenticationService {
<?php
use DI\Container;
use DI\ContainerBuilder;
use Slim\App;
use Tuupola\JwtAuthentication;
$containerBuilder = new ContainerBuilder();
$containerBuilder->addDefinitions([
'JwtAuthenticationSettings' => [
'secret' => getenv('jwt_secret'),
@l0gicgate
l0gicgate / errors.txt
Created February 18, 2019 05:36
Doctrine Coding Standards
FILE: /mnt/c/Users/l0gicgate/Dropbox/Software/github/Slim/Slim/App.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
65 | ERROR | @var annotation of property \Slim\App::$settings does not specify type hint for its items.
78 | ERROR | @param annotation of method \Slim\App::__construct() does not specify type hint for items of its traversable parameter $settings.
140 | ERROR | @return annotation of method \Slim\App::getSettings() does not specify type hint for items of its traversable return value.
162 | ERROR | @param annotation of method \Slim\App::addSettings() does not specify type hint for items of its traversable parameter $settings.
---------------------------------------------------------------------------------------------
@l0gicgate
l0gicgate / createBrowserHistory.js
Created July 26, 2018 20:38
History.block behavior fix
import { createLocation } from 'history/LocationUtils';
import { addLeadingSlash, stripTrailingSlash, stripBasename, createPath } from 'history/PathUtils';
import { getConfirmation, supportsHistory, supportsPopStateOnHashChange, isExtraneousPopstateEvent } from 'history/DOMUtils';
import createTransitionManager from './createTransitionManager';
const PopStateEvent = 'popstate';
const HashChangeEvent = 'hashchange';
const getHistoryState = () => {
try {
@l0gicgate
l0gicgate / RequestMethodDetector.php
Last active February 16, 2018 06:46
Determine all allowed request methods for a request outside of slim app
<?php
use FastRoute\Dispatcher;
use FastRoute\RouteParser;
use FastRoute\RouteParser\Std as StdParser;
use FastRoute\RouteCollector;
use FastRoute\DataGenerator\GroupCountBased as GroupCountBasedDataGenerator;
use Psr\Http\Message\RequestInterface;
use Slim\Route;
use Slim\Router;
@l0gicgate
l0gicgate / API.js
Last active January 16, 2021 08:07
import * as Rx from 'rxjs';
import queryString from 'query-string';
/**
* This function simply transforms any actions into an array of actions
* This enables us to use the synthax Observable.of(...actions)
* If an array is passed to this function it will be returned automatically instead
* Example: mapObservables({ type: ACTION_1 }) -> will return: [{ type: ACTION_1 }]
* Example2: mapObservables([{ type: ACTION_1 }, { type: ACTION_2 }]) -> will return: [{ type: ACTION_1 }, { type: ACTION_2 }]
*/
import React, { Component } from 'react';
import Paper from 'material-ui/Paper';
const panelStyle = {
width: '400px',
marginLeft: '42%',
marginRight: '50%',
}
class PaperPanel extends Component {
import React from 'react';
import ReactDOM from 'react-dom';
import ReactFlux from 'react-flux';
import './index.css';
import AppForm from './react-components/AppForm';
import registerServiceWorker from './registerServiceWorker';
import axios from 'axios';
function getApplications() {
@l0gicgate
l0gicgate / App.js
Last active November 23, 2017 22:19
import React from 'react';
import ReactDOM from 'react-dom';
import Hydrator from './Hydrator';
import DataComponent from './DataComponent';
const App = () => <Hydrator><DataComponent /></Hydrator>;
ReactDOM.render(<App />, 'app');
import React from 'react';
import { defineMessages } from 'react-intl';
import FormattedAnchor from './FormattedAnchor';
const messages = defineMessages({
menuItem: {
id: 'menu.item',
defaultMessage: 'Menu Item',
},
menuItem1: {