Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php
and app/Http/Middleware/Authenticate.php
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.
Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php
and app/Http/Middleware/Authenticate.php
<?php | |
// This is code to return custom error message | |
// for Youtube tutorial: Laravel 5.4 Additional Login Conditions | |
// https://www.youtube.com/watch?v=Z8s6uhhD1Pk | |
namespace App\Http\Controllers\Auth; |
# Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/ | |
# YouTube video https://youtu.be/hBC_tVJIx5w | |
# Client id from Google Developer console | |
# Client Secret from Google Developer console | |
# Scope this is a space seprated list of the scopes of access you are requesting. | |
# Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes. | |
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=http://127.0.0.1&scope=[Scopes]&response_type=code | |
# Exchange Authorization code for an access token and a refresh token. |
Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<style type="text/css" rel="stylesheet" media="all"> | |
/* Media Queries */ | |
@media only screen and (max-width: 500px) { |
127.0.0.1 mc.corel.com | |
127.0.0.1 apps.corel.com |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title><%= htmlWebpackPlugin.options.title %></title> | |
</head> | |
<body> | |
<input id="float"/> | |
</body> | |
</html> |
function downloadFile() { | |
var blob = ""; | |
var xhr = new XMLHttpRequest(); | |
xhr.onload = function(){ | |
if (this.status == 200) { | |
blob = new Blob([xhr.response], { type: 'application/pdf' }); | |
var link = document.createElement('a'); |
# Copyright 1999-2011 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# | |
# /etc/screenrc | |
# | |
# This is the system wide screenrc. | |
# | |
# You can use this file to change the default behavior of screen system wide | |
# or copy it to ~/.screenrc and use it as a starting point for your own | |
# settings. |
private static void enableGzipIfNeeded(spark.Request request, spark.Response response) { | |
String accept = request.headers("Accept-Encoding"); | |
if (accept == null) { | |
return; | |
} | |
String[] tokens = accept.split(","); | |
if (Arrays.stream(tokens).map(String::trim).anyMatch(s -> s.equalsIgnoreCase("gzip"))) { | |
response.header("Content-Encoding", "gzip"); | |
} | |
} |