Skip to content

Instantly share code, notes, and snippets.

View alejandromav's full-sized avatar
🐦
\' ;drop table users; --

Alejandro Martin alejandromav

🐦
\' ;drop table users; --
View GitHub Profile
@alejandromav
alejandromav / tinybird-mongodb-connector.sh
Last active June 28, 2023 08:45
Tinybird MongoDB Connector v0.0.0
FILE=~/tmp/items.ndjson
mongoexport \
--uri="mongodb://<user>:<pass>@alejandromav.mongodb.net/?retryWrites=true&w=majority" \
-d=my_db \
-c=Items \
-o=$FILE
curl \
-H 'Authorization: Bearer $TINYBIRD_APPEND_TOKEN' \
@alejandromav
alejandromav / timezones.json
Last active August 9, 2022 16:31
Timezone dictionary
{
"Africa/Abidjan": "CI",
"Africa/Accra": "GH",
"Africa/Addis_Ababa": "ET",
"Africa/Algiers": "DZ",
"Africa/Asmara": "ER",
"Africa/Bamako": "ML",
"Africa/Bangui": "CF",
"Africa/Banjul": "GM",
"Africa/Bissau": "GW",
@alejandromav
alejandromav / README.md
Last active June 22, 2022 09:43
Technical Product Manager, Data & Analytics

Technical Product Manager, Data & Analytics

We're looking for an experienced Technical Product Manager to join our team and help us build data and analytics products for internal use.

At Inditex, we're focused on our customers and you'll be able to reach millions of them with your passion and dedication. New ideas became incredible products and services, join us in building the future of eCommerce retailing.

Description

We are looking for a team member with a strong foundation in Computer Science theory and industry experience. In this role, you'll own and lead the roadmap of several internal tools.

@alejandromav
alejandromav / index.js
Created July 27, 2021 08:43
Get JavaScript object nested attributes
function propertiesToArray(obj) {
const isObject = val => typeof val === 'object' && !Array.isArray(val);
const isArray = val => Array.isArray(val);
// Format output keys
const addDelimiter = (a, b, type) => a ? `${a}.[${b}: ${type}]` : `[${b}: ${type}]`;
const paths = (obj = {}, head = '') => {
return Object.entries(obj).reduce((product, [key, value]) => {
let fullPath = addDelimiter(head, key, typeof value);
@alejandromav
alejandromav / README.md
Last active March 30, 2021 11:16
Certbot certificates generation

Install certbot

sudo apt update
sudo apt install certbot

Generate certificate with DNS challenge

@alejandromav
alejandromav / avro_wire_format_poc.js
Last active April 6, 2020 15:45
Avro Wire format
// https://docs.confluent.io/current/schema-registry/serializer-formatter.html#wire-format
const avro = require('avsc');
const schemas = {
1337: {
type: 'record',
fields: [
{name: 'name', type: 'string'}
]
@alejandromav
alejandromav / fix_wsl_dns.sh
Created March 23, 2020 10:24
Fix WSL DNS resolving for VPNs
#!/bin/bash
tmp=`mktemp`
powershell="/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
trap ctrlC INT
removeTempFiles() {
rm -f $tmp
}
@alejandromav
alejandromav / start-docker-containers.sh
Last active February 10, 2023 15:56
Docker start commands
# MySQL
docker run --rm \
--name mysql \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=toor \
-v ~/Data/mysql:/var/lib/mysql \
-d mysql \
--local_infile=1
# MongoDB
@alejandromav
alejandromav / .editorconfig
Created September 30, 2019 14:37
Editor config
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = 120
@alejandromav
alejandromav / google-holiday-calendars.json
Last active January 14, 2020 10:58
Google Calendar Holidays - by country ISO2
{
"ad": "en.ad#holiday@group.v.calendar.google.com",
"ae": "en.ae#holiday@group.v.calendar.google.com",
"af": "en.af#holiday@group.v.calendar.google.com",
"al": "en.al#holiday@group.v.calendar.google.com",
"am": "en.am#holiday@group.v.calendar.google.com",
"ao": "en.ao#holiday@group.v.calendar.google.com",
"ar": "en.ar#holiday@group.v.calendar.google.com",
"at": "en.austrian#holiday@group.v.calendar.google.com",
"au": "en.australian#holiday@group.v.calendar.google.com",