Skip to content

Instantly share code, notes, and snippets.

View simonardejr's full-sized avatar

Simonarde Lima simonardejr

  • Brazil
View GitHub Profile
@simonardejr
simonardejr / install-php8-cli.sh
Last active December 27, 2020 15:39
simple script to install php8 (cli)
#!/bin/bash
# add repository
sudo add-apt-repository ppa:ondrej/php
# update apt
sudo apt update
# install php8
sudo apt install php8.0-cli php8.0-bcmath php8.0-common php8.0-curl php8.0-gd php8.0-gmp php8.0-intl php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-pgsql php8.0-readline php8.0-redis php8.0-sqlite3 php8.0-xml php8.0-xsl php8.0-zip -y
@simonardejr
simonardejr / axios-401-response-interceptor.js
Created February 6, 2020 14:33 — forked from yajra/axios-401-response-interceptor.js
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,
@simonardejr
simonardejr / Python3 Virtualenv Setup.md
Created April 22, 2018 10:11 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@simonardejr
simonardejr / comoSerChatoNoWhatsapp.js
Created January 25, 2018 18:46 — forked from callmeloureiro/comoSerChatoNoWhatsapp.js
Como fazer alguém te responder no whatsapp
/*
Hoje iremos MUDAR a vida da pessoa que não te responde no whatsappp...
Que tal enviar mensagens pra ela até obter uma resposta?!
Sensacional não acha?! Mas, somos devs, correto?! Então vamos automatizar esse paranauê!
Para utilizar:
- Abra o web.whatsapp.com;
- Selecione a conversa que você quer;
- Abra o console e cole o código que está no gist;
@simonardejr
simonardejr / index.php
Created December 29, 2016 20:55
Remake of the famous Raspberry Pi Sysinfo Script
<?php
// modified by PROXIMO https://gist.github.com/PROX1MO
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 May 1983 13:00:00 GMT");
header("Pragma: no-cache");
function NumberWithCommas($in)
{
return number_format($in);
}
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
function human_filesize($bytes, $decimals = 2) {
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}
@simonardejr
simonardejr / bootstrap.sh
Created April 21, 2014 16:26
bootstrap.sh : Instalando Apache2, PHP5, MySQL, Curl, Composer e Git em uma VM criada pelo Vagrant.
#!/usr/bin/env bash
echo 'Começando o provisionamento...'
# Atualizando os pacotes
apt-get update
# Definindo a senha do user root do MySQL (pulando o prompt de instalacao)
# User: root / Pwd: root
echo mysql-server-5.5 mysql-server/root_password password root | debconf-set-selections