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 / cikrf.py
Last active April 22, 2018 22:55 — forked from alexshpilkin/cikrf.py
Russian elections
#!/usr/bin/env python3
import sys
import time
from bs4 import BeautifulSoup
import urllib3
pool = urllib3.PoolManager(10)
#Up to date data
ROOT_URL = 'http://www.vybory.izbirkom.ru/region/region/izbirkom?action=show&root=1&tvd=100100084849066&vrn=100100084849062&region=0&global=1&sub_region=0&prver=0&pronetvd=null&type=227'
@mateuspestana
mateuspestana / replicacao_park.R
Last active June 26, 2019 16:45
Tentativa de replicação do artigo de Park & Bali, denominado "International Terrorism and the Political Survival of Leaders"
### Tentativa de replicação do artigo de Park & Bali
## Natália Trindade e Mateus Pestana
### Carregando os pacotes necessários
pacman::p_load(tidyverse, rio,
survminer, survival,
stargazer, rms,
bife, janitor,
sjPlot, margins,
000000000002
00000000000A
00000000000B
0000000018DE
0000014B5C31
00000FFE2488
003003003003
003CC420001A
010203040506
0123456789AB

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

@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.
import Cocoa
/// BOOLEANS
let filename = "EtBilu.jpg"
print(filename.hasSuffix(".jpg"))
let numero = 120
print(numero.isMultiple(of: 11))
/// 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])
// 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 {}.
/*
Agora eu sei comentar da forma correta!
LOOPS
*/
let platforms = ["iOS", "macOS", "tvOS", "watchOS", "CarPlay"]
for os in platforms {
print("Swift é ótimo para \(os)")
/*
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)