Skip to content

Instantly share code, notes, and snippets.

View filiperocha's full-sized avatar

Filipe Rocha filiperocha

View GitHub Profile
@filiperocha
filiperocha / iterm2.md
Last active September 30, 2023 07:25 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@filiperocha
filiperocha / AuthyToOtherAuthenticator.md
Created March 18, 2020 06:47 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues

@filiperocha
filiperocha / docker-cleanup-resources.md
Created October 2, 2018 11:04 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Keybase proof

I hereby claim:

  • I am filiperocha on github.
  • I am filiperocha (https://keybase.io/filiperocha) on keybase.
  • I have a public key ASDH2-bwbk2-B5MfZjR2w60e2Mo9BSAbII2lmOyGp1-jpQo

To claim this, I am signing this object:

@filiperocha
filiperocha / lock.css
Created June 8, 2017 09:47 — forked from visnup/lock.css
"lock" orientation of a website for mobile (iPad, iPhone)
/* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */
@media (orientation: portrait) {
body {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}
# encoding: utf-8
# @author Filipe Rocha <filiperocha@gmail.com>
# Describe Portugal's Administrative Areas
class DistritoConcelho
# @return [Array] list of [concelho, [distritos]]
def self.list
[
['Aveiro', ['Águeda', 'Albergaria-a-Velha', 'Anadia', 'Arouca', 'Aveiro', 'Castelo de Paiva', 'Espinho', 'Estarreja', 'Santa Maria da Feira', 'Ílhavo', 'Mealhada', 'Murtosa', 'Oliveira de Azeméis', 'Oliveira do Bairro', 'Ovar', 'São João da Madeira', 'Sever do Vouga', 'Vagos', 'Vale de Cambra']],
['Beja', ['Aljustrel', 'Almodôvar', 'Alvito', 'Barrancos', 'Beja', 'Castro Verde', 'Cuba', 'Ferreira do Alentejo', 'Mértola', 'Moura', 'Odemira', 'Ourique', 'Serpa', 'Vidigueira']],
@filiperocha
filiperocha / couchdb-undelete.rb
Created February 20, 2016 07:46 — forked from vjt/couchdb-undelete.rb
Undeletes a document from a CouchDB database.
#!/usr/bin/env ruby
#
# Undelete a document from a CouchDB database.
#
# Recovers a previously deleted document by looking at the _changes
# feed, putting a new empty document preserving the revisions chain,
# retrieves the revs_info for the document, asks the user which one
# to recover, and puts back the old revision into place.
#
# For this to work, GETting the document must return error: "not_found",
@filiperocha
filiperocha / VariableImporter.jsx
Last active January 3, 2016 12:33
Import Illustrator Variables
/**
* @@@BUILDINFO@@@ VariableImporter.jsx !Version! Tue Dec 15 2015 03:06:17 GMT-0600
*/
/*
============================= VARIABLE IMPORTER Version 7.1.3 ==============================
By Vasily Hall
e:
vasily.hall@gmail.com
LinkedIn:
table .blue { color: #049cdb; border-bottom-color: #049cdb; } table .green { color: #46a546; border-bottom-color: #46a546; } table .red { color: #9d261d; border-bottom-color: #9d261d; } table .yellow { color: #ffc40d; border-bottom-color: #ffc40d; } table .orange { color: #f89406; border-bottom-color: #f89406; } table .purple { color: #7a43b6; border-bottom-color: #7a43b6; }
@filiperocha
filiperocha / colors.css
Created January 3, 2014 20:10
colors.css
table .blue {
color: #049cdb;
border-bottom-color: #049cdb;
}
table .green {
color: #46a546;
border-bottom-color: #46a546;
}
table .red {
color: #9d261d;