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
soulmachine / jwt-expiration.md
Last active Feb 19, 2020
How to deal with JWT expiration?
View jwt-expiration.md

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
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]'))
console.log('React.js');
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"]'))
console.log('Angular.js');
@dreamorosi
dreamorosi / standardJS-in-CRA.md
Last active Feb 19, 2020
Add Standard JS to create-react-app project
View standardJS-in-CRA.md

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

or

@ericclemmons
ericclemmons / example.md
Last active Feb 10, 2020
HTML5 <details> in GitHub
View example.md

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!

<details>
 <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;
if(schema.has.been.created){
var mondrianschema = $(this.el).find(".schemaselect").val();
enabled = true;
}
var c = "type=OLAP\n"+
"name="+name+"\n"+
"driver=mondrian.olap4j.MondrianOlap4jDriver\n"+
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active Jan 12, 2020
es6 spread immutable cheatsheet
View es6-spread-immutable-cheatsheet.md

update object

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

var newState = {
@brenopolanski
brenopolanski / ftp.md
Last active Nov 8, 2015
FTP via linha de comando
View ftp.md

Conectando

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