Skip to content

Instantly share code, notes, and snippets.

View juliozuppa's full-sized avatar

Julio Cesar Zuppa juliozuppa

  • Curitiba, PR, Brasil
View GitHub Profile
@joseluisq
joseluisq / 1README.md
Last active January 3, 2022 13:22
Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

Lumen 5 HTTP Exception Handlers with JSON support.

Configure PHP Lumen 5 HTTP Exception Handlers with common JSON responses.

image

Setup

Copy (replace) only the attached files to their respective directories. app/Exceptions/Handler.php and app/Http/Middleware/Authenticate.php

@SaeedPrez
SaeedPrez / LoginController.php
Created March 12, 2017 16:42
Laravel 5.4 Additional Login Conditions - Add custom error message.
<?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;
@LindaLawton
LindaLawton / GoogleAuthenticationCurl.sh
Last active December 4, 2024 23:07
Curl bash script for getting a Google Oauth2 Access token
# 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.
@yannbertrand
yannbertrand / using_xdebug_with_postman.md
Created December 6, 2016 15:04
Using xDebug with POSTMAN

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM

@introwit
introwit / verification.blade.php
Created October 11, 2016 15:41
Email verification blog - part 4
<!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
@ksrb
ksrb / index.ejs
Last active March 10, 2021 05:58
jquery.inputmask webpack configuration and package.json
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<input id="float"/>
</body>
</html>
@allanortiz
allanortiz / ajax-download-file.js
Created April 11, 2016 20:43
Download file (PDF) with AJAX.
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.
@kleinron
kleinron / enableGzip.java
Last active January 24, 2019 18:50
spark java enable gzip if needed
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");
}
}