Skip to content

Instantly share code, notes, and snippets.

View tiagoad's full-sized avatar
🔨

Tiago tiagoad

🔨
View GitHub Profile
@tiagoad
tiagoad / fenix_extract.md
Last active September 24, 2019 14:06
Converte o horário do Fénix para iCal (Google Calendar, etc)
  1. Abrir o horário no fénix e escolher o semestre

  2. Abrir a consola do browser (Ctrl+Shift+J / Cmd+Opt+J)

  3. Fazer paste do código abaixo e pressionar Enter

  4. Importar os ficheiros .ical para o calendário

    Google: https://calendar.google.com/calendar/r/settings/export

Testado no Chrome, no Fénix da FCUL.

@tiagoad
tiagoad / 2018_f1.hs
Created January 23, 2018 18:06
Exames de Princípios de Programação - FCUL
import Test.QuickCheck
-- Grupo 1
-- a)
encontra :: (a -> Bool) -> [a] -> Maybe a
encontra f xs
| length matches == 0 = Nothing
| otherwise = Just (head matches)
where
@tiagoad
tiagoad / text.md
Created January 15, 2018 23:33
RTP play download

Criar marcador com URL javascript:document.location.href = 'https://streaming-ondemand.rtp.pt/' + player1.fileKey

@tiagoad
tiagoad / cloud-config.yml
Last active July 25, 2017 14:37
Rancher server cloud-init
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVu1ZLh/TEoTgQz8Og06/4ll5R5qpFZBtty8ijyjj4k07GQu6vHJSr4ATsjcs3o1yYKzPJlxNng8sj4A9zuJLCe7RN3XYuNSpUG+/9i3uuoIuGuLqaLVupsZw+/9InnAS8oR4IWZt6V4ts5lvzx25bOxj27TLGYTAWbk1thGG/e5wWn+d+tmmd5/AM+4ocGY6XL0xnVjqwHRimjL9evmD0fvuNc2wmy1jrIewJWJzDOyg5/cie8Q1zYdWG6hYRfiPoixnR8fW5i/qi25SWm7mzKkHyRTczkqJifaFN9EDpq+AoNOwNDp8GevTjC6OL4UbgXsUY1NH9WugmKLnNb1HN
rancher:
services:
rancher-server:
image: rancher/server
restart: always
ports:
- 8080:8080

Keybase proof

I hereby claim:

  • I am tiagoad on github.
  • I am tiagod (https://keybase.io/tiagod) on keybase.
  • I have a public key whose fingerprint is 0B67 ABDA D8CE 2815 300A D3B2 0B08 3446 5FF2 F4B7

To claim this, I am signing this object:

@tiagoad
tiagoad / findreplace.sh
Created May 20, 2017 19:45
Replaces unicode characters with ASCII-safe alternatives
#!/bin/bash
# findreplace
# ===========
# Replaces unicode characters with ASCII-safe alternatives
# Single-letter words á, à and é are replaced with a', 'a and e'
## check commands
SED=sed
if gsed --version >/dev/null 2>&1 ; then
@tiagoad
tiagoad / block-tor.sh
Created July 21, 2016 10:40
Cronjob to block tor exit nodes with nginx on debian 8 jessie
wget -qO- https://check.torproject.org/exit-addresses | grep ExitAddress | cut -d ' ' -f 2 | sed "s/^/deny /g; s/$/;/g" > /etc/nginx/conf.d/tor-block.conf; systemctl reload nginx
directory: ../Original
library: ./library.blb
import:
copy: yes
write: yes
move: no
ignore: .AppleDouble ._* *~ .DS_Store
@tiagoad
tiagoad / MightyDump.md
Last active August 29, 2015 14:21
MightyText conversation dumper / exporter

Select the conversation you want to export, open the browser javascript console, and paste the javascript inside it. The conversation will be dumped to the input box.

Star if it was helpful to you c:

@tiagoad
tiagoad / rtorrent
Created August 8, 2014 14:39
rtorrent init file
#!/bin/bash
### BEGIN INIT INFO
# Provides: rtorrent
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop rtorrent daemon
### END INIT INFO