Skip to content

Instantly share code, notes, and snippets.

@tad3j
tad3j / BaseAgGrid.js
Last active September 23, 2022 19:34
Reusable ag-grid component for React which provides support for URL query filters and sorting
import React, { useEffect, useState } from 'react'
import { AgGridReact } from '@ag-grid-community/react'
import { AllCommunityModules } from '@ag-grid-community/all-modules'
import { DEFAULT_COLUMN_DEFINITIONS, gridInit } from '../../helpers/agGrid'
import {
cleanUpQuery,
GridFilterService,
} from '../../../services/ag-grid/GridFilterService'
import PropTypes from 'prop-types'
import { useHistory } from 'react-router'
@tad3j
tad3j / Handler.php
Created December 11, 2016 16:00
Redirect guests to login page in case of 404
<?php
namespace App\Exceptions;
//use Auth;
use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
<?php
namespace RacApi\V1\Authentication;
use Zend\Authentication\AuthenticationService;
use ZfcRbac\Exception;
use ZfcRbac\Identity\IdentityProviderInterface;
use Doctrine\ORM\EntityManager;
//use User\Entity\User;
@tad3j
tad3j / CustomNoObjectExistsValidator.php
Created July 24, 2014 16:14
Extending doctrine NoObjectExists and ObjectUnique to allow custom filtering by key/value pairs
<?php
namespace Application\Validator;
use DoctrineModule\Validator\NoObjectExists as NoObjectExistsValidator;
use Zend\Validator\Exception;
use Doctrine\Common\Persistence\ObjectRepository;
class CustomNoObjectExistsValidator extends NoObjectExistsValidator
{
@tad3j
tad3j / OauthAccessToken.php
Created July 3, 2014 11:44
Apigility Oauth Entites
<?php
namespace RacApi\V1\Entity\Oauth;
use Doctrine\ORM\Mapping as ORM;
/**
* OauthAccessToken
*
* @ORM\Table(name="oauth_access_tokens")
* @ORM\Entity()