Skip to content

Instantly share code, notes, and snippets.

View emtudo's full-sized avatar

Leandro Henrique Reis emtudo

View GitHub Profile
/**
* Class to check up e-mail
*
* @author Konstantin Granin <kostya@granin.me>
* @copyright Copyright (c) 2010, Konstantin Granin
*/
class VerifyEmail {
/**
@emtudo
emtudo / optimus.desktop
Last active April 29, 2018 13:58
Problema de travamento com vídeo no ubuntu 18.04
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer
@emtudo
emtudo / xorg.conf
Last active August 6, 2018 13:47
Travamento com vídeo Ubuntu 18.04: editar ou criar /etc/X11/xorg.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
@emtudo
emtudo / promise.all.js
Last active December 11, 2017 11:31
Promise.all
Promise.all([
promise1,
promise2,
promise3
]).then(() => {
return this.$router.push({'name': 'minha rota'})
})
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use BotMan\BotMan\Cache\LaravelCache;
use BotMan\BotMan\Storages\Drivers\FileStorage;
use BotMan\BotMan\BotManFactory;
use BotMan\Drivers\Facebook\FacebookDriver;
use BotMan\BotMan\Drivers\DriverManager;
@emtudo
emtudo / minio-s3.php
Created October 4, 2017 15:21
minio s3
<?php
'minio' => [
'driver' => 's3',
'endpoint' => env('MINIO_ENDPOINT', 'https://127.0.0.1:9000'),
'use_path_style_endpoint' => true,
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'region' => env('AWS_REGION'),
'bucket' => env('AWS_BUCKET'),
],
// Controller
// Metodo do controle que faz a chacagem
protected function checkRecaptcha($token, $ip)
{
$response = (new Client)->post('https://www.google.com/recaptcha/api/siteverify', [
'form_params' => [
'secret' => config('services.recaptcha.secret'),
'response' => $token,
<template>
<div>
</div>
</template>
<script>
/**
* base: https://github.com/finpo/vue2-recaptcha-invisible
*global window document
*/
@emtudo
emtudo / onsaved
Last active April 27, 2017 16:35
doOnSaved (entity) {
entity = prepareEntity(entity)
const entities = this.entities.data
const current = entities.find(row => row.id === entity.id)
if (current === undefined) {
entities.push(entity)
}
else {
entities[entities.indexOf(current)] = entity
#listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name SEU-DOMINIO.COM www.SEU-DOMINIO.COM;
if ($ssl_protocol = "") {
rewrite ^ https://$server_name$request_uri? permanent;
}
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;