Skip to content

Instantly share code, notes, and snippets.

View jhowbhz's full-sized avatar
🦾
Um programador apaixonado pelo que faz

Jhon jhowbhz

🦾
Um programador apaixonado pelo que faz
View GitHub Profile
@jhowbhz
jhowbhz / install.sh
Created June 15, 2021 06:25 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@jhowbhz
jhowbhz / crontab.md
Last active August 31, 2023 14:41
create job in laravel with crontab in ubuntu 1 in 1 minute
First

Create a job in laravel with command artisan

php artisan make:command ExampleCron --command=example:cron

Second

Navigate to file create in project

app\Console\Commands\ExampleCron.php

@jhowbhz
jhowbhz / format_BRL_JavaScript.js
Last active August 6, 2019 20:12
format BRL JavaScript
// function transform BRL em DECIMAL // R$ 1.000,00 em 1000.00
function formatMoeda(get_valor) {
replace = get_valor.replace('.', '');
retorno = replace.replace(',', '.');
return retorno;
}
// set front-end money BRL (R$) JavaScript
@jhowbhz
jhowbhz / datatables.js
Created May 24, 2019 18:35
datatables
$('#tbl_completa').DataTable({
"dom": "'B'"+"<'row'<'col-xs-6'l><'col-xs-6'f>>\
<'row'<'col-xs-12'<'table-responsive't>r>>\
<'row'<'col-xs-5'i><'col-xs-7'p>>",
buttons: [
{
extend: 'excelHtml5',
text: '<i class="fas fa-file-excel-o"></i>',
titleAttr: 'Exportar Excel'
},
@jhowbhz
jhowbhz / Kernel.php
Created February 5, 2019 19:12
ssl-middleware
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
// adicionar esta linha
'MyApp\Http\Middleware\HttpsProtocol'
@jhowbhz
jhowbhz / HttpsProtocol.php
Created February 5, 2019 19:11
ssl-middleware
namespace MyApp\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\App;
class HttpsProtocol {
public function handle($request, Closure $next)
{
if (!$request->secure() && App::environment() === 'production') {
@jhowbhz
jhowbhz / comandos-git
Created February 4, 2019 15:06 — forked from trgomes/comandos-git
Alguns comados git
#Configurações básicas
git config --global user.name "<username>"
git config --global user.email "<email>"
git config --global core.editor <comando editr> //Opcional
#Todas as informações de configuração
git config --list
#Verificar configuração
git config user.name
@jhowbhz
jhowbhz / Deploy heroku - laravel
Created February 4, 2019 15:06 — forked from trgomes/Deploy heroku - laravel
Deploy de uma aplicação laravel no heroku
*Pré requisitos *********
=> git instalado
=> heroku cli instalado
=> aplicação gerenciada pelo git
*************************
#Login no heroku
heroku login
#Criando aplicação
@jhowbhz
jhowbhz / emul.bat
Created January 31, 2019 13:13
Open AVD image ANDROID_STUDIO .BAT
@ CD %userprofile%\AppData\Local\Android\Sdk\emulator
@ ECHO SUAS "AVDS" CRIADAS NO ANDROID_STUDIO
@ ECHO -----------------------------
@ emulator -list-avds
@ ECHO -----------------------------
@ ECHO Por favor, digite o nome da sua imagem antes de continuar...
@ SET /p iso=NOME AVD --^>
@ emulator -avd %iso%
@jhowbhz
jhowbhz / connect_ssh.txt
Created November 5, 2018 04:08
connect ssh heroku
heroku run bash -app=XXXXX