Skip to content

Instantly share code, notes, and snippets.

Working from home

Breno Polanski brenopolanski

Working from home
Block or report user

Report or block brenopolanski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
soulmachine /
Last active Feb 19, 2020
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

rambabusaravanan / detect-js-framework.js
Last active Feb 19, 2020
Detect JS Framework used in a Website
View detect-js-framework.js
// Pase these lines into website's console ( Ctrl/Cmd + Shift + I )
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]'))
if(!!window.angular ||
!!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') ||
!!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]'))
dreamorosi /
Last active Feb 19, 2020
Add Standard JS to create-react-app project

Standard JS in create-react-app

I've been using create-react-app lately as I find it very useful to kick things off while starting a project. I almost always follow JavaScript Standard Style and I found myself googling it so I figured out I should write it down.

Get Standard JS

I really like keeping dependencies as local as possible but if you prefer you can install it globally.

yarn add standard --dev


ericclemmons /
Last active Feb 10, 2020
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

 <summary>Summary Goes Here</summary>
View example.js
var name = $(this.el).find("input[name='connname']").val();
var path = $(this.el).find("select[name='csvpath']").val();
var enabled = false;
var mondrianschema = $(this.el).find(".schemaselect").val();
enabled = true;
var c = "type=OLAP\n"+
gorangajic /
Last active Jan 12, 2020
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"

var newState = {
brenopolanski /
Last active Nov 8, 2015
FTP via linha de comando


ftp endereço ip / nome do host <ENTER>
coloque o seu nome de usuário <ENTER>
coloque a sua senha <ENTER>

Baixando uma pasta via comando wget

brenopolanski /
Created Sep 16, 2015
Saiku external working with Node.js
var port = process.env.C9_PORT || parseInt(argv[2], 10) || 8081;
var backend_host = argv[3] || '';
var backend_port = argv[4] || 9999;
brenopolanski /
Created Sep 15, 2015
Check if value is in select list with JQuery
var x = 'foo';
var exists = 0 != $('#select-box option[value=" + x + "]').length;
brenopolanski /
Created Sep 12, 2015
Leaflet working with HTTPS
You can’t perform that action at this time.