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
brenopolanski /
Created Nov 28, 2019 — forked from soulmachine/
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:

brenopolanski /
Created Jul 1, 2019
Add e remover usuário Windows 10

Crie um novo usuário:

1. Pressione as teclas Windows + X e clique em Prompt de Comando (Admin).

2. Digite os comandos abaixo, seguido de Enter para execução:

net user nome-da-conta /add

net localgroup administrators nome-da-conta /add
brenopolanski / reset.css
Created May 18, 2019 — forked from simonausten/reset.css
Email CSS Reset
View reset.css
<style type="text/css">
.ExternalClass {
width: 100%;
/* Forces to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Forces to display normal line spacing, here is more on that: */
brenopolanski /
Created Mar 25, 2019
Using with React components
View gives you the native DOMNode, then you need to use the regular DOM APIs to access attributes. For instance getAttribute or dataset.

  onClick={ this.props.onClick } 
brenopolanski /
Created Feb 25, 2019 — forked from subfuzion/
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

brenopolanski /
Last active Feb 26, 2019
Install Keycloak and disable HTTPS (for development mode)
  1. Download Keycloak Server:
  2. Create user via CLI. e.g: ./bin/ -u admin
  3. Disable HTTPS on H2 database:
java -cp modules/system/layers/base/com/h2database/h2/main/h2-1.4.193.jar -url "jdbc:h2:./standalone/data/keycloak" -user sa -password sa -sql "update REALM set ssl_required='NONE' where id = 'master'"
  1. Run server. e.g: ./bin/ -b
brenopolanski /
Created Feb 15, 2019
Getting previous month first day and future month last day using moment.js
const prevMonthFirstDay = moment().subtract(1, 'months').date(1);

const nextMonthLastDay = moment().add(2, 'months').date(0);


const prevMonthFirstDay = moment().subtract(1, 'months').startOf('month');
brenopolanski / wget-jdk-oracle-install-example.txt
Created Feb 14, 2019 — forked from sr75/wget-jdk-oracle-install-example.txt
wget command to install Oracle JAVA JDK from stupid oracle website for centos and ubuntu
View wget-jdk-oracle-install-example.txt
# rpm
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
"" \
-O jdk-7-linux-x64.rpm
# ubuntu
brenopolanski /
Last active Feb 7, 2019
Nextcloud Cors with PHP Headers

Update nextcloud/remote.php:

try {
        require_once __DIR__ . '/lib/base.php';

        // All resources served via the DAV endpoint should have the strictest possible
        // policy. Exempted from this is the SabreDAV browser plugin which overwrites
        // this policy with a softer one if debug mode is enabled.
        header("Content-Security-Policy: default-src 'none';");
You can’t perform that action at this time.