Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
beep

Tiago tiagoad

🤖
beep
View GitHub Profile
@tiagoad
tiagoad / docker-compose.yml
Created May 21, 2020
Uber Cadence on Docker Swarm + mySQL
View docker-compose.yml
version: '3.5'
networks:
# for use by containers in other docker-compose files to connect to cadence
cadence:
# telegraf network (set up in another docker-compose file, you can replace with your own logging solution)
monitoring_monitoring:
external: true
@tiagoad
tiagoad / macos-pyodbc-freetds-mssql-django.md
Last active Aug 18, 2019
macOS Mojave + pyodbc + FreeTDS + SQL Server + Django 2.2
View macos-pyodbc-freetds-mssql-django.md

pyODBC + FreeTDS

  1. Run brew install unixodbc freetds
  2. Add section to /usr/local/etc/odbcinst.ini:
    [FreeTDS]
    Description     = FreeTDS unixODBC Driver
    Driver          = /usr/local/lib/libtdsodbc.0.so
    Setup           = /usr/local/lib/libtdsodbc.0.so
    UsageCount      = 1
@tiagoad
tiagoad / remote-devtools-render-poc.js
Created Jan 25, 2019
Remote browser/electron monitor through the devtools protocol
View remote-devtools-render-poc.js
'use strict';
const puppeteer = require('puppeteer');
const CDP = require('chrome-remote-interface');
const fs = require('fs').promises;
function timeout(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
@tiagoad
tiagoad / userChrome.css
Created Jan 6, 2019
No tabs, No sidebar title. FF Quantum @ MacOS
View userChrome.css
/* Hide sidebar title for TST */
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;
}
/* From https://github.com/Timvde/UserChrome-Tweaks/blob/master/tabs/hide-tabs-macos.css */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@tiagoad
tiagoad / monitor-dir.py
Created Dec 9, 2018
Monitors a directory (and its' children) for changes on Windows, asynchronously (overlapped mode).
View monitor-dir.py
# Based partially on http://timgolden.me.uk/python/win32_how_do_i/watch_directory_for_changes.html (thanks!)
import os
import time
import win32file
import win32con
import pywintypes
import winerror
@tiagoad
tiagoad / monitor-dir.py
Created Dec 9, 2018
Uses ReadDirectoryChangesW asynchronously (overlapped mode) to monitor a directory (and its' children) for changes.
View monitor-dir.py
import os
import time
import win32file
import win32con
import pywintypes
import winerror
WATCHED_DIR = "./mon"
@tiagoad
tiagoad / fenix_extract.md
Last active Sep 24, 2019
Converte o horário do Fénix para iCal (Google Calendar, etc)
View fenix_extract.md
  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 Jan 23, 2018
Exames de Princípios de Programação - FCUL
View 2018_f1.hs
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 Jan 15, 2018
RTP play download
View text.md

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

@tiagoad
tiagoad / cloud-config.yml
Last active Jul 25, 2017
Rancher server cloud-init
View cloud-config.yml
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
You can’t perform that action at this time.