Skip to content

Instantly share code, notes, and snippets.

View fferegrino's full-sized avatar
📖
Learning

Antonio Feregrino fferegrino

📖
Learning
View GitHub Profile
@fferegrino
fferegrino / example_window.py
Created February 26, 2024 16:03
Bytewax join example
import json
from datetime import datetime, timezone, timedelta
import bytewax.operators.window as op_w
from bytewax.bytewax import EventClockConfig, SessionWindow
from bytewax.dataflow import Dataflow
import bytewax.operators as op
from bytewax.connectors.files import FileSource
from bytewax.connectors.stdio import StdOutSink
@fferegrino
fferegrino / pyproject.toml
Created October 24, 2022 22:32
Messed up Poetry
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Antonio Feregrino <antonio.feregrino@gmail.com>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.8"
#!/usr/bin/env bash
function dopptx {
source_folder=$(basename -- $1)
tmp_folder="${source_folder}_tmp"
slides_name="${source_folder%%_*}.pptx"
cp -r $source_folder $tmp_folder
find $tmp_folder -type f -name "*.xml" -exec sh -c "cat {} | xmllint --noblanks - | sponge {}" \;
@fferegrino
fferegrino / client_creation.py
Created May 4, 2022 08:02
Gists related to the "Downloading data from Reddit using Python" post.
reddit = praw.Reddit(
client_id=os.environ["CLIENT_ID"],
client_secret=os.environ["CLIENT_SECRET"],
password=os.environ["PASSWORD"],
user_agent="Live Thread Scraper by UkraineNewsBot",
username="UkraineNewsBot",
)
@fferegrino
fferegrino / daily.yml
Last active May 4, 2022 05:14
Snippets for "Downloading data from Reddit using Python"
name: Download dataset
on:
schedule:
- cron: "0 10 * * *"
jobs:
process:
runs-on: ubuntu-latest
steps:
@fferegrino
fferegrino / fix_author.sh
Last active July 15, 2021 08:07
Git GPG stuff
git commit --amend --author="Antonio Feregrino <antonio.feregrino@xxxxx.xxx>"
@fferegrino
fferegrino / Dockerfile
Created April 8, 2020 06:55
Create Minecraft maps!
# http://www.aaronbell.com/how-to-create-overviewer-maps-from-minecraft-realms/
FROM python:3.8
RUN git clone https://github.com/air/minecraft-tools.git && cd minecraft-tools
RUN apt-get update && apt-get install -y httpie jq && \
apt-get install -y software-properties-common && apt-add-repository 'deb http://overviewer.org/debian ./'
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
@fferegrino
fferegrino / parser.py
Created February 14, 2020 05:28
Reading/parsing medium emails
from bs4 import BeautifulSoup
MEDIUM_URL = "https://medium.com/"
URL_LEN = len(MEDIUM_URL)
def parse(message, **kwargs):
soup = BeautifulSoup(message, "lxml")
main = soup.find("table", {"class":"email-fillWidth"})
digest = main.find("table", {"class":"email-digest"})
@fferegrino
fferegrino / config.txt
Created October 11, 2019 04:53
A Raspbian config file
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# Enable VGA monitor through converter
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
hdmi_drive=2
hdmi_group=2
hdmi_mode=35
@fferegrino
fferegrino / libros_sep.py
Created August 8, 2019 17:09
Descargando los libros de la SEP... for the lols
def descarga():
pass