Skip to content

Instantly share code, notes, and snippets.

View tvieiragoncalves's full-sized avatar
🏠
Working from home

Tiago Gonçalves tvieiragoncalves

🏠
Working from home
View GitHub Profile
@tvieiragoncalves
tvieiragoncalves / BitcoinPrice.ps1
Created April 2, 2023 20:20
The script will start running and will continuously print the current Bitcoin price in USD every 5 seconds
$url = "https://api.coinbase.com/v2/prices/spot?currency=USD"
while ($true) {
$response = Invoke-RestMethod $url
$price = $response.data.amount
Write-Host "Current Bitcoin Price: $"$price
Start-Sleep -Seconds 5
}
@tvieiragoncalves
tvieiragoncalves / PY0101EN-5-2-Numpy2D.ipynb
Created August 4, 2019 11:59
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tvieiragoncalves
tvieiragoncalves / Untitled.ipynb
Created July 30, 2019 15:53
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tvieiragoncalves
tvieiragoncalves / gist:ce381dd9c53fd6d99bd4bca9b3dbfc55
Created June 18, 2019 16:22
Um quiz em python sobre a cultura portuguesa
# -*- coding: utf-8 -*-
def pergunta():
while (True):
try:
um = "1 - Lisboa"
dois= "2 - coimbra"
tres= '3 - Porto'
quatro= '4 - Quintal da minha avó'
print(um,dois,tres,quatro)

Central Coast Psychology

Prototyping a site for a mate. Tring to keep it plain and simple, focusing on content and accesibility.

It's a 1 pager with scrollspy and modals for additional content considered too long for the flow. Google maps needs to be imbedded with a private key, hence the image placeholder

A Pen by Tiago Gonçalves on CodePen.

License.

@tvieiragoncalves
tvieiragoncalves / scraper.py
Created May 11, 2018 17:25
Scraper para selecionar os títulos dos posts de um blog em jekyll
# Bibliotexas necessárias
import requests
import bs4
#get.request da página a analisar
fonte = requests.get('https://tvieiragoncalves.github.io/genesis/')
#Transformar o objecto em soup object, escolher o parser a utilizar
soup = bs4.BeautifulSoup(fonte.text, 'lxml')
#função para escolher todo o texto com a mesma tag e finalmente fazer print
for paragrafo in soup.find_all('h3'):
@tvieiragoncalves
tvieiragoncalves / eventos.py
Last active April 20, 2018 01:23
Eventos na cidade do porto no Eventbrite API
import requests
response = requests.get(
"https://www.eventbriteapi.com/v3/events/search?location.address=porto,portugal",
headers = {
"Authorization": "Bearer AUTHtoken",
},
verify = True, # Verify SSL certificate
)
print response.json()['events'][0]['name']['text']
print response.json()['events'][1]['name']['text']
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@tvieiragoncalves
tvieiragoncalves / INSTALL
Created February 1, 2018 01:43 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation
###### development tools
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk
### Python packages
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib
### pip packages
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython
@tvieiragoncalves
tvieiragoncalves / e-mail.py
Created December 12, 2017 20:34
Python script to send e-mail
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import smtplib
server = smtplib.SMTP('smtp.gmail.com', 587)
#Next, log in to the server
server.ehlo()
server.starttls()
server.ehlo()
server.login("youremail@gmail.com", "Password")
#Send the mail with input