Skip to content

Instantly share code, notes, and snippets.

View sirolad's full-sized avatar
🏠
Working from home

Surajudeen Akande sirolad

🏠
Working from home
View GitHub Profile
@sirolad
sirolad / braking.md
Created March 1, 2021 08:03
Fahrschule
@sirolad
sirolad / .htaccess
Created May 23, 2019 09:26 — forked from Zodiac1978/.htaccess
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
{
"errors": {
"email": [
"The email has already been taken."
]
}
}
<?php
namespace App\Http\Requests;
use Illuminate\Http\JsonResponse;
use Illuminate\Validation\ValidationException;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Foundation\Http\FormRequest as LaravelFormRequest;
@sirolad
sirolad / Handler.php
Created September 18, 2017 18:28
Modified global exception for JSON in app/Exceptions/Hander.php file
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
...
@sirolad
sirolad / index.blade.php
Created July 20, 2017 17:53
Simple View for our app
<!DOCTYPE html>
<html>
<head>
<title>Account Kit (Laravel)</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style type="text/css">
pre {
display: block;
padding: 9.5px;
@sirolad
sirolad / index.html
Created July 20, 2017 17:50
AccountKit SDK
<script type="text/javascript" src="https://sdk.accountkit.com/en_US/sdk.js"></script>
<?php
$validator = new XmlValidator;
$validated = $validator->validateFeeds('sample.xml');
if ($validated) {
echo "Feed successfully validated";
} else {
print_r($validator->displayErrors());
}
@sirolad
sirolad / XmlValidator.php
Last active March 22, 2017 22:28
A class to validate xml using XMLReader
<?php
class XmlValidator
{
/**
* @var string
*/
protected $feedSchema = __DIR__ . '/sample.xsd';
/**
* @var int
<?php
$validator = new DomValidator;
$validated = $validator->validateFeeds('sample.xml');
if ($validated) {
echo "Feed successfully validated";
} else {
print_r($validator->displayErrors());
}