Skip to content

Instantly share code, notes, and snippets.

View emtudo's full-sized avatar

Leandro Henrique Reis emtudo

View GitHub Profile
@emtudo
emtudo / autosyncgithub.sh
Last active July 4, 2016 17:59
Auto Sync github
#!/bin/bash
cd /path/autosync
if [ ! -z "$1" ]; then
if [ -d $1 ] && [ $1 != "." ]; then
cd "$1"
pwd
git pull
fi
exit 0
fi
@emtudo
emtudo / auto_sync_git.sh
Last active June 20, 2016 23:37 — forked from gnumoksha/auto_sync_git.sh
Does the git pull of all subdirectories
#!/bin/bash
# This script syncs (i.e. makes git pull) on a specified directory or, se no
# parameter was specified, in all the subdirectories that are git projects.
#
# Usage:
# ./auto_sync_git.sh directory_of_my_project
# ./auto_sync_git.sh
# An alias to the git binary
if (!function_exists('array_rows_to_columns')) {
/**
* rows to columns.
*
* @param array $array
* @return array
*/
function array_rows_to_columns(array $data)
{
$newArray = [];
#!/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" \
#!/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}
#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;
@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
<template>
<div>
</div>
</template>
<script>
/**
* base: https://github.com/finpo/vue2-recaptcha-invisible
*global window document
*/
// 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,
@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'),
],