Skip to content

Instantly share code, notes, and snippets.

View Ziggoto's full-sized avatar
🎯
Focusing

Fábio Theophilo Ziggoto

🎯
Focusing
  • Guidewire Software
  • Dublin, Ireland
  • X @Ziggoto
View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCnebbAXHH/T4Bz0dQS/DdfD3iI9FXbOE9j8JfNPFP3Z6ZvfbL9+hW4t6E78LZ+JN2cymKi884txhiM+ML9Mco6V9qLSZs5aXLuxVz/4pt0juKQZUYQqqD5xmwivbzN8Y/PMRGHIHCDt1i3AxkaJ2wi3sSyItsYWv3zJKKGEPgWETZ19IMIaghCyuJd4LYomXHsyDznAgYyuk7JcDpkPdAOFQJio4spj9WErWRx/AcbGsh2MmkjHSMtWiVs2SVrijipOEorwHQ9WjLv0GFtlXemdhYGctZiafcJs5uqll2+nEhIh1x7uqFtjoe5Tga8T/YmWSsC9nQyMSNLX1z0lYWodv2O3jOrGRDDUExvdLzcoiACmgYuOzk9GvHJ99c9oWVfMdyRrjZ8uj9SK6cFmFID7YRJYrmQPqO/gaj5UyDr5kXI6AVAtFvSealaOhRPhJDC5Uy92HgtDwAd0tOU3aKFMBJHoRWl2YYdq32iBeoVsRSb5WrGsH0SGWGCAI4coQM= fabiotheophilo@Fabios-MacBook-Pro.local
:let ratio = split(execute('!curl --silent https://api.exchangeratesapi.io/latest\?base\=USD | jq .rates.BRL'))[-1] | let currentLine = getline(line('.')) | echo printf('%f', str2float(currentLine) * str2float(ratio))
:let a = 1 | let b = 1 | let c = 1 | let fib = 10 | for i in range(1, fib) | let c = a + b | put =printf('%d + %d = %d', a, b, c) | let a = b | let b = c | endfor
@Ziggoto
Ziggoto / gist:73126329c5c225c44c4f634b82e88e30
Last active August 15, 2020 23:11
Factorial command in VIM
:let fat = 10 | let aux = 1 | for i in range(1, fat) | let prevAux = aux | let aux = aux * i | put =printf('%d x %d = %d', prevAux, i, aux)
@Ziggoto
Ziggoto / format-js.sh
Last active October 9, 2018 19:11
It indents all .js files from current directories to all subdirectories (needs `fd` installed but can be replaced easily by `find`)
fd -e js | xargs -n1 bash -c '</dev/tty vim -c "normal! gg=G" -c "x" "$@"' ignoreme
@Ziggoto
Ziggoto / podcast.opml
Created February 5, 2018 19:49
Meus podcasts
<?xml version="1.0" encoding="utf-8"?>
<opml version="2.0">
<head>
<title>gPodder subscriptions</title>
<dateCreated>Mon, 05 Feb 2018 16:48:18 -0300</dateCreated>
</head>
<body>
<outline text="Aprimore o seu inglês diáriamente com estes mini-podcasts de 5 minutos com o professor Tim Barrett de www.domineingles.com.br. Aprenda inglês do dia a dia, expressões, phrasal verbs, preposições, collocations e muito mais!" title="Inglês Todos os Dias" type="rss" xmlUrl="http://feeds.feedburner.com/inglestodososdias"/>
<outline text="O mundo vira piada no Jovem Nerd" title="NerdCast" type="rss" xmlUrl="https://jovemnerd.com.br/feed-nerdcast/"/>
<outline text="Discussões acaloradas sobre startups, programação, ux, gadgets e as últimas tendências em tecnologia." title="Hipsters Ponto Tech" type="rss" xmlUrl="https://hipsters.tech/feed/podcast/"/>
@Ziggoto
Ziggoto / spotify_listening.sh
Created February 22, 2017 19:47
Command line to show what I'm listening on Spotify
spot_song=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Metadata); echo $(echo $spot_song | sed -ne 's/xesam:artist: \(.*\)$/\1/p') "-" $(echo $spot_song | sed -ne 's/xesam:title: \(.*\)$/\1/p')
@Ziggoto
Ziggoto / artists_graph.py
Created December 13, 2016 17:29
Testando o Pandas (biblioteca de Data Analysis para Python). Dados retirados do meu próprio perfil do Last.fm. Dia da coleta: 13/12/2016
import re
import pandas as pd
import matplotlib.pyplot as plt
artist = open('top_artists.csv')
csv = [(line[0], int(line[1].replace('.', ''))) for line in re.findall(r"\d+\s(.+?)\s([\d\.]+)$", artist.read(), re.MULTILINE)]
df = pd.DataFrame(csv, columns=['artist', 'scrobbles'])
# print df
#!/usr/bin/python
# -*- coding: utf-8 -*-
matrix = [[None for j in xrange(10)] for i in xrange(10)]
def print_matrix():
for line in matrix:
for col in line:
print str(col)+'\t',
print ''
#!//usr/bin/python
import re
import urllib2
import PyRSS2Gen
from bs4 import BeautifulSoup
url = 'https://one-piecex.com.br/'
user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0'