Skip to content

Instantly share code, notes, and snippets.

View mateuspestana's full-sized avatar
🧨
Focusing on Swift and Python

Mateus Pestana mateuspestana

🧨
Focusing on Swift and Python
View GitHub Profile
@mateuspestana
mateuspestana / bp_lula.py
Last active April 27, 2024 13:36
Raspa BP
import numpy as np
import pandas as pd
import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager
# Edge
import streamlit as st
import pandas as pd
import requests
def baixaDeputados(idLegislatura):
url = 'https://dadosabertos.camara.leg.br/api/v2/deputados?idLegislatura=' + str(idLegislatura)
r = requests.get(url)
deputados = r.json()['dados']
df = pd.DataFrame(deputados)
return df
/*
Valores default para parâmetros
*/
// Para especificar um valor padrão para um parâmetro em uma função, podemos fazer o seguinte:
func printTabuada(for number: Int, end: Int = 10) {
for i in 1...end {
print("\(i) x \(number) = \(i * number)")
/*
Funções
*/
import Foundation
// Funções são úteis para reciclar código.
// Em uma função como
let roll = Int.random(in: 1...20)
/*
Agora eu sei comentar da forma correta!
LOOPS
*/
let platforms = ["iOS", "macOS", "tvOS", "watchOS", "CarPlay"]
for os in platforms {
print("Swift é ótimo para \(os)")
// CONDITIONS
let score = 85
if score > 80 {
print("Boa!")
}
// Aqui temos uma condição IF, seguida da condição em si (score maior que 80). Se a resposta disso for true, ele executa o comando entre {}.
/// ARRAYS
var beatles = ["John", "Paul", "George", "Ringo"]
let numbers = [4, 8, 15, 16, 23, 42]
var temperatures = [25.3, 28.2, 26.4]
// Em Swift, guardamos vários itens em um único objeto chamado array. Arrays são feitos com []. Para encontrar um item dentro de um array, o Swift indexa em zero.
print(beatles[0])
print(numbers[1])
import Cocoa
/// BOOLEANS
let filename = "EtBilu.jpg"
print(filename.hasSuffix(".jpg"))
let numero = 120
print(numero.isMultiple(of: 11))
@mateuspestana
mateuspestana / dia1_hws.swift
Created July 6, 2022 00:23
[Dia 1] HackingWithSwift - Variáveis, Constantes, Strings e Números
import Cocoa
// Cocoa é uma biblioteca que contém diversas funções, métodos, estruturas, etc, para o MacOS, facilitando assim a programação.
/// VARIÁVEIS E CONSTANTES
var greeting = "Hello, playground"
// var é a palavra que usamos para criar uma nova variável. No caso, o padrão do Playground é criar uma variável chamada greeting que tem como valor "Hello, playground".
// LEMBRANDO: Variável é tudo aquilo que varia e que PODE variar ao longo do programa.

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION