Skip to content

Instantly share code, notes, and snippets.

View blalop's full-sized avatar

Alejandro Blanco blalop

View GitHub Profile
class PID:
def __init__(self, kp, ki, kd):
self.kp = kp
self.ki = ki
self.kd = kd
self.acc_e = 0
self.prev_e = 0
def proportional(self, e):
return self.kp * e
@blalop
blalop / index.html
Created February 16, 2019 22:17
Get Minecraft server status
<!DOCTYPE html>
<html lang="en">
<head>
<title>Minecraft Server Info</title>
<meta charset="utf-8">
<style>
body {
font-family: sans-serif;
color: #ffffff;
@blalop
blalop / acu
Last active June 10, 2020 18:28
Archives, compresses, encrypts and uploads a folder to Dropbox. Document backup purpose.
#!/bin/bash
OAUTH_ACCESS_TOKEN=<YOUR OAUTH ACCESS TOKEN HERE>
PASSPHRASE=<YOUR PASSPHRASE>
archive_and_compress_folder() {
tar -czf "$1.tar.gz" "$1"
}
encrypt_file() {
@blalop
blalop / letterboxd.py
Created January 27, 2022 23:35
Fill letterboxd exported data using OMDb API
import csv
import json
import requests
DIR = '/path/to/files'
API_KEY = 'apikey'
URL = 'http://www.omdbapi.com'
_, TITLE, YEAR, _ = range(4)