Skip to content

Instantly share code, notes, and snippets.

Working from home

Breno Polanski brenopolanski

Working from home
View GitHub Profile
brenopolanski /
Created Sep 27, 2020 — forked from ibrahimtuzlak0295/
Create virtual host in XAMPP, Ubuntu 16.04/18.04/20.04

I’ll go step-by-step on how to create a virtual host in the XAMPP environment. As we know, the default http://localhost points to /opt/lampp/htdocs as the root directory. The desired result is to be able to visit http://examplevhost.local, with the root directory being /opt/lampp/htdocs/examplevhost.

Note: The steps below are done on Ubuntu 16.04, but they should also work on most other Linux distributions (Debian, Mint, Arch).

Note: I’ll assume that XAMPP is installed in /opt/lampp/. If it’s different on your setup, please read carefully and adjust accordingly.

Enable virtual hosts in apache configuration file

Note: This should be done only once per XAMPP installation. If you want to add another virtual host later you can skip to the next step.

brenopolanski / string-utils.js
Created Apr 13, 2020 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
View string-utils.js
// String utils
// resources:
// -- mout,
* "Safer" String.toLowerCase()
function lowerCase(str) {
return str.toLowerCase();

update object

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

var newState = {
brenopolanski /
Last active Mar 19, 2020
Filter VueJS getters and setters
log: function(d) {
    console.log(Object.assign({}, this.form));

// if you have jQuery
log: function(d) {
    console.log($.extend({}, this.form));
brenopolanski / force-scrollbars-visible.css
Created Mar 13, 2020 — forked from IceCreamYou/force-scrollbars-visible.css
Mac OS X hides scrollbars by default. This is annoying for UI design because it means users might not realize that certain areas are scrollable. This public domain Gist forces the scrollbar to always be visible with native behavior in Webkit-based browsers (Chrome and Opera) on Macs.
View force-scrollbars-visible.css
.force-show-scrollbars ::-webkit-scrollbar-track:vertical {
border-left: 1px solid #E7E7E7;
box-shadow: 1px 0 1px 0 #F6F6F6 inset, -1px 0 1px 0 #F6F6F6 inset;
.force-show-scrollbars ::-webkit-scrollbar-track:horizontal {
border-top: 1px solid #E7E7E7;
box-shadow: 0 1px 1px 0 #F6F6F6 inset, 0 -1px 1px 0 #F6F6F6 inset;
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 } 
You can’t perform that action at this time.