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 / px-rem-tw.csv
Created February 6, 2021 01:19 — forked from trevorgreenleaf/px-rem-tw.csv
PX to REM'S to TAILWIND CSS
PX REM TW
4 0.25 1
8 0.5 2
16 1 4
32 2 8
48 3 12
64 4 16
80 5 20
96 6 24
112 7 28
@brenopolanski
brenopolanski / example.md
Last active August 5, 2022 05:32
Convert HTML to a PDF in React.JS

The idea is to convert : HTML -> Canvas -> PNG (or JPEG) -> PDF

To achieve the above, you'll need :

  1. html2canvas
  2. jsPDF
import React, { Component } from 'react';
@brenopolanski
brenopolanski / install-firefox-nightly.md
Created July 30, 2014 00:34
Install Firefox Nightly in Ubuntu via PPA

via: http://www.webupd8.org/2011/05/install-firefox-nightly-from-ubuntu-ppa.html

Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

@brenopolanski
brenopolanski / reload-page-once.md
Created May 12, 2015 00:58
Reload an HTML page just once using JavaScript
if (window.location.href.substr(-2) !== '?r') {
    window.location = window.location.href + '?r';
}

or:

window.onload = function() {
@brenopolanski
brenopolanski / resize-map-leaflet.md
Created August 27, 2015 12:25
Resize and center map Leaflet
map._onResize();
map.panTo(new Saiku.leaflet.LatLng(21.505, -0.09));
@brenopolanski
brenopolanski / install-popcorn-time.md
Created June 24, 2014 23:59
Install Popcorn Time in Ubuntu / Linux Mint / Debian via PPA

via: http://www.webupd8.org/2014/05/install-popcorn-time-in-ubuntu-or.html

To add the WebUpd8 Popcorn Time PPA and install the app in Ubuntu / Linux Mint (and elementary OS along with Ubuntu derivatives: Xubuntu, Kubuntu, etc.), use the following commands:

$ [sudo] add-apt-repository ppa:webupd8team/popcorntime
$ [sudo] apt-get update
$ [sudo] apt-get install popcorn-time

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@brenopolanski
brenopolanski / solving-cors-pentaho-cde.md
Last active February 23, 2021 17:40
Solving CORS problem on embedding Pentaho CDE dashboard in web application

Solving CORS problem on embedding Pentaho CDE dashboard in web application

Cross-Origin Resource Sharing (CORS) is a W3C spec that allows cross-domain communication from the browser. By building on top of the XMLHttpRequest object, CORS allows developers to work with the same idioms as same-domain requests.

Enable Cross Origin Resource Sharing (CORS) in the Community Dashboard Framework (CDF), Community Dashboard Editor (CDE), and Community Data Access (CDA). While you need CDE to embed the dashboard, you will access it from a different server other than the Pentaho Server, so CORS must be enabled in CDF, CDE and CDA. Open the following CDF, CDE, and CDA settings.xml files in a text editor:

  • For CDF: server/pentaho-server/pentaho-solutions/system/pentaho-cdf/settings.xml.
  • For CDE: server/pentaho-server/pentaho-solutions/system/pentaho-cdf-dd/settings.xml.
  • For CDA: server/pentaho-server/pentaho-solutions/system/cda/settings.xml.
@brenopolanski
brenopolanski / npm-list-globally.md
Created November 1, 2016 19:34
Listing globally installed NPM packages and version
npm list -g --depth=0
@brenopolanski
brenopolanski / README.md
Created January 11, 2021 12:34
DPKG error while installation bcmwl-kernel-source on ubuntu 20.04