Skip to content

Instantly share code, notes, and snippets.

View emtudo's full-sized avatar

Leandro Henrique Reis emtudo

View GitHub Profile
@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;
#!/bin/bash
DIR="/DIRETORIO_ROOT_DO_SEU_SITE"
EMAIL="SEU-EMAIL@SEU-DOMINIO.COM"
DOMINIO="SEU-DOMINIO.COM"
sudo ./certbot-auto certonly --webroot --webroot-path \
${DIR} \
--renew-by-default --email ${EMAIL} --text --agree-tos \
-d ${DOMINIO} \
-d www.${DOMINIO}
#!/bin/bash
API_KEY="SUA CHAVE SECRETA AQUI"
API_EMAIL="seu email"
ZONE_ID="ZONA DNS"
DOMINIO="dominio.com"
#Lista os registros, necessário para pegar o id para alterar a zona DNS
#curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records" \