Skip to content

Instantly share code, notes, and snippets.

View eduardogspereira's full-sized avatar
🛰️

Eduardo Pereira eduardogspereira

🛰️
View GitHub Profile
@eduardogspereira
eduardogspereira / s3_janitor.sh
Created April 26, 2018 19:26
Delete files from S3 that are older than X days.
#!/bin/bash
# You need to uncomment two lines for the script work.
# Please check the logic before use it.
main () {
#aws s3 ls $BUCKETNAME | grep -v ' PRE ' | grep -v ' 0 ' > data.txt
UNIXDAYS=$(date -d "$DAYS days ago" +%s)
while read LINE
do
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eduardogspereira
eduardogspereira / README.md
Created June 11, 2018 02:33 — forked from rochoa/README.md
CARTO Node.js code test

CARTO Node.js code test

Introduction

At CARTO, among other things, we render maps, just check this example of Map with countries and USA states.

In order to limit the scope of the challenge, we are gonna use Mapnik and Node.js. Within this repository, we are providing all the pieces you need to reproduce that map. Well, all pieces except the map tile server.

An example of how to create an image with Mapnik:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const { execSync } = require("child_process");
const readline = require("readline").createInterface({
input: process.stdin,
output: process.stdout
});
const rawData = execSync("pacman -Q");
const programs = rawData
.toString()
.split("\n")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Date:
def __init__(self, day, month, year):
self.day = day
self.month = month
self.year = year
my_birthday = Date(16, 4, 1991)
today = Date(28, 6, 1991)
def make_days_of_months(is_leap_year):