Skip to content

Instantly share code, notes, and snippets.

View marcelometal's full-sized avatar
🤘

Marcelo Jorge Vieira marcelometal

🤘
View GitHub Profile
@marcelometal
marcelometal / thumbor.service
Created July 27, 2015 22:25
Thumbor systemd
# File: /lib/systemd/system/thumbor.service
[Unit]
Description=Photo thumbnail service
[Service]
Type=simple
ExecStart=/usr/bin/thumbor -c /etc/thumbor.conf
[Install]
@marcelometal
marcelometal / fix_tsuru_copyright_notice_year.sh
Created September 3, 2017 18:37
Tsuru: Fixed copyright notice year

Keybase proof

I hereby claim:

  • I am marcelometal on github.
  • I am metal (https://keybase.io/metal) on keybase.
  • I have a public key whose fingerprint is 5FAE 7D03 CCD2 2E1C 8DA9 C509 5B92 4EE3 1005 5CD3

To claim this, I am signing this object:

@marcelometal
marcelometal / thumbor_schroot.sh
Last active December 18, 2017 00:57
Thumbor: schroot
sessionid="thumbor"
schroot -b -c sid -n $sessionid
dd-schroot-cmd -c $sessionid apt-get update
dd-schroot-cmd -c $sessionid apt-get -y upgrade
dd-schroot-cmd -c $sessionid apt-get -y install devscripts build-essential lintian
dd-schroot-cmd -c $sessionid apt-get -y build-dep thumbor
schroot -r -c $sessionid
apt-get source thumbor
@marcelometal
marcelometal / fields.py
Last active April 15, 2018 15:37
ElasticSearch: Candidatos politicos brasileiros
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Marcelo Jorge Vieira <metal@alucinados.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@marcelometal
marcelometal / i18n.js
Last active July 10, 2018 14:24
__()
// i18n shim! I feel bad for doing this =(
// https://github.com/megawac/async/blob/d2dd36b4558f483682f3c672630fdcb36a96d4d2/lib/async.js#L16
((typeof self === "object" && self.self === self && self) ||
(typeof global === "object" && global.global === global && global) ||
this).__ = (x) => x;
@marcelometal
marcelometal / main.go
Last active June 27, 2021 20:29
Eleições 2020: Candidados
// Copyright (c) 2020, Marcelo Jorge Vieira
// Licensed under the MIT License
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
@marcelometal
marcelometal / import.sh
Created November 15, 2020 19:43
Importar YAML para finance wallet API
PURCHASES_TYPE="stocks fiis treasuries-direct certificates-of-deposit stocks-funds ficfi"
for X in $PURCHASES_TYPE; do
echo "Inserting $X data...";
DATA=$(python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout)' < $X.yaml | jq -c '.[]')
for ITEM in $DATA; do
curl -X POST "http://localhost:8889/api/v1/$X/operations" -H 'Content-Type: application/json' -d "$ITEM";
done
echo "done!";
echo "";
echo "";
# Copyright (c) 2020, Marcelo Jorge Vieira
# License MIT
## fiis.yaml
## - portfolioSlug: default
## itemType: fiis
## symbol: TGAR11
## brokerSlug: easyinvest
## shares: 35
## price: 138.62