Skip to content

Instantly share code, notes, and snippets.

View mpayetta's full-sized avatar

Mauricio Payetta mpayetta

  • Mar del Plata, Argentina
View GitHub Profile
@mpayetta
mpayetta / plot.js
Last active March 28, 2018 22:18
d3-canvas-6
// Init Scales
const x = d3.scaleLinear()
.domain([0, d3.max(dataExample, (d) => d[0])])
.range([0, width])
.nice();
const y = d3.scaleLinear()
.domain([0, d3.max(dataExample, (d) => d[1])])
.range([height, 0])
.nice();
@mpayetta
mpayetta / plot.js
Created March 28, 2018 22:29
d3-canvas-7
// Add Axis
const gxAxis = svgChart.append('g')
.attr('transform', `translate(0, ${height})`)
.call(xAxis);
const gyAxis = svgChart.append('g')
.call(yAxis);
// Add labels
svgChart.append('text')
@mpayetta
mpayetta / plot.js
Created March 28, 2018 22:37
d3-canvas-8
// Draw on canvas
dataExample.forEach( point => {
drawPoint(point);
});
function drawPoint(point) {
context.beginPath();
context.fillStyle = pointColor;
const px = x(point[0]);
const py = y(point[1]);
@mpayetta
mpayetta / postman-install.sh
Created April 7, 2018 23:41
Install Postman on Ubuntu
# to install it
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
# to create desktop entry
cat > ~/.local/share/applications/postman.desktop <<EOL
@mpayetta
mpayetta / docker-compose.yml
Created August 29, 2018 19:59
Docker compose for wichita
version: '2.1'
services:
wichita-frontend:
build: wichita-api-dashboard-frontend # specify the directory of the Dockerfile
ports:
- "8080:80"
wichita-api:
build: wichita-api-dashboard # specify the directory of the Dockerfile