Skip to content

Instantly share code, notes, and snippets.

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

Jonathan Henrique jhowbhz

:shipit:
Um programador apaixonado pelo que faz
View GitHub Profile
@paulodutra
paulodutra / 8-link-simbolico-pasta-storage-laravel.sh
Created January 13, 2020 17:24
Comando responsável por criar o link simbólico no laravel e permitir acessar o arquivo enviado através do diretório public da aplicação
@CesarBalzer
CesarBalzer / backup.js
Created June 22, 2018 19:26
Script backup sqllite cordova com o plugin sqlporter e arquivo txt na raiz do dispositivo
/**
*
* @var db Base de dados para backup e restauracao
*/
var db = window.openDatabase("CAMINHO DO BANCO", "1.0", "NOME DO BANCO", 5 * 2048);
/**
* Mostra o erro de arquivo
* @param {obj} error Recebe o objeto de erro
* @returns {void}
*/
@jhowbhz
jhowbhz / Laravel_Detalhes.txt
Last active January 17, 2019 18:29
Detalhes de como instalar o LARAVEL ubuntu 16
# EXTENSÕES PHP
sudo apt install php7.2 libapache2-mod-php7.2 php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-cli php7.2-zip
# INSTALANDO O COMPOSER UBUNTU 16+
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
#PERMISSÕES PASTA PROJETO
sudo chown -R www-data:www-data /var/www/html/MyProject/
sudo chmod -R 755 /var/www/html/MyProject/
<!DOCTYPE html>
<html>
<title> TESTE AJAX </title>
<body>
<button onclick="nome_da_funcao()">CLIQUE AQUI</button>
<div id="teste"> </div>
</body>
</html>
@trgomes
trgomes / diferenca-dias.js
Created April 11, 2018 13:55
Calcular diferença de dias com JS
//Define um data de inicio
var startDate = new Date('2018-03-20');
//Determina os dias para estimativa (EX.: Expira em 30 dias, faltam 30 dias...)
var estimate = 30;
//Retorna a quantidade de dias restantes para o tempo estimado
function remainingDays(startDate, estimate){
//Define a data atual com a final
var finishDate = new Date().getFullYear() + "-" + (new Date().getMonth()+1) + "-" + new Date().getDate();
@trgomes
trgomes / comandos-git
Last active April 28, 2021 02:13
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
@trgomes
trgomes / Deploy heroku - laravel
Created January 5, 2018 00:20
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
@WillDent
WillDent / pm2_ubuntu.sh
Last active February 2, 2022 13:34
Installation of PM2 on Ubuntu so it autostarts scripts
# Requirements:
# Node Installed
# Safe User that is running as node
#1) Install pm2
sudo npm install -g pm2
#2) Set-up PM2 to autostart upon server rebooting
#sudo env PATH=$PATH:/usr/local/bin pm2 startup <platform> -u <safe_user_not_root>
sudo env PATH=$PATH:/usr/local/bin pm2 startup ubuntu -u ubuntu