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
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
@mpayetta
mpayetta / lambda-3.js
Created March 27, 2018 21:42
lambda-3.js
var aws = require('aws-sdk');
var nodemailer = require('nodemailer');
var ses = new aws.SES();
var s3 = new aws.S3();
function getS3File(bucket, key) {
return new Promise(function (resolve, reject) {
s3.getObject(
{