Skip to content

Instantly share code, notes, and snippets.

View simonardejr's full-sized avatar

Simonarde Lima simonardejr

  • Brazil
View GitHub Profile
@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];
}