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
View es6-spread-immutable-cheatsheet.md

update object

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

var newState = {
@brenopolanski
brenopolanski / merge-pdf-ghostscript.md
Last active Mar 31, 2020
Merge multiple PDFs using Ghostscript
View merge-pdf-ghostscript.md

A simple Ghostscript command to merge two PDFs in a single file is shown below:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Install Ghostscript:

Type the command sudo apt-get install ghostscript to download and install the ghostscript package and all of the packages it depends on.

@brenopolanski
brenopolanski / export-svg-inkscape.md
Created Dec 26, 2017
Exporting an object as svg from inkscape
View export-svg-inkscape.md
  1. Select the object(s) to export
  2. Open the document properties window (Ctrl+Shift+D)
  3. Select "Resize page to drawing or selection"
  4. File > Save As Copy...
  5. Select Optimized SVG as the format if you want to use it on the web
@brenopolanski
brenopolanski / docker-cp-container-host.md
Created Nov 2, 2017
Docker - copy file from container to host
View docker-cp-container-host.md

In order to copy a file from a container to the host, you can use the command:

docker cp <containerId>:/file/path/within/container /host/path/target
@brenopolanski
brenopolanski / vuejs-getters-and-setters.md
Last active Mar 19, 2020
Filter VueJS getters and setters
View vuejs-getters-and-setters.md
log: function(d) {
    console.log(Object.assign({}, this.form));
}

// if you have jQuery
log: function(d) {
    console.log($.extend({}, this.form));
}
@brenopolanski
brenopolanski / index.html
Created Nov 21, 2015
Start, Stop and Reset Javascript SetInterval
View index.html
<div class="btns">
<a href="" id="set" class="btn">Set/Reset</a>
<a href="" id="stop" class="btn">Stop</a>
</div>
<div id="container"></div>
@brenopolanski
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;
}
View saiku-url-params.md
@brenopolanski
brenopolanski / vue-axios-cors.md
Last active Feb 7, 2020
Vue.js + Axios + CORS
View vue-axios-cors.md

Proxy requests using Webpack dev server to avoid cors in development mode.

In your webpack.config file add:

"devServer":{
  "proxy": {
    "/api": {
    "target": 'https://my-target.com',
    "pathRewrite": { '^/api': '' },
@brenopolanski
brenopolanski / solving-cors-pentaho-cde.md
Last active Jan 22, 2020
Solving CORS problem on embedding Pentaho CDE dashboard in web application
View solving-cors-pentaho-cde.md

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.
You can’t perform that action at this time.