Skip to content

Instantly share code, notes, and snippets.

View brenopolanski's full-sized avatar
🦙
Llama Llama

Breno Polanski brenopolanski

🦙
Llama Llama
View GitHub Profile
@brenopolanski
brenopolanski / xampp-virtualhost.md
Created September 27, 2020 00:16 — forked from ibrahimtuzlak0295/xampp-virtualhost.md
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
brenopolanski / string-utils.js
Created April 13, 2020 17:48 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str) {
return str.toLowerCase();

update object

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

var newState = {
@brenopolanski
brenopolanski / vuejs-getters-and-setters.md
Last active March 19, 2020 12:47
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
brenopolanski / force-scrollbars-visible.css
Created March 13, 2020 14:17 — 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.
.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
brenopolanski / jwt-expiration.md
Created November 28, 2019 15:04 — forked from soulmachine/jwt-expiration.md
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
brenopolanski / saiku-url-params.md
Created September 17, 2019 18:24
Saiku 3 URL Params
@brenopolanski
brenopolanski / readme.md
Created July 1, 2019 13:01
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
brenopolanski / reset.css
Created May 18, 2019 16:06 — forked from simonausten/reset.css
Email CSS Reset
<style type="text/css">
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {
width: 100%;
}
/* Forces Outlook.com to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Forces Outlook.com to display normal line spacing, here is more on that: http://www.emailonacid.com/forum/viewthread/43/ */
@brenopolanski
brenopolanski / react-event-target.md
Created March 25, 2019 11:17
Using event.target with React components

event.target gives you the native DOMNode, then you need to use the regular DOM APIs to access attributes. For instance getAttribute or dataset.

<button 
  data-space="home" 
  className="home" 
  data-txt="Home" 
  onClick={ this.props.onClick } 
/> 
 Button