Skip to content

Instantly share code, notes, and snippets.

View IgnacioHeredia's full-sized avatar

Ignacio Heredia IgnacioHeredia

View GitHub Profile
@IgnacioHeredia
IgnacioHeredia / send_email.py
Last active April 26, 2024 22:15
Send emails with Hotmail
import argparse
import email
import smtplib
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--from_user', type=str)
parser.add_argument('--from_pwd', type=str)
@IgnacioHeredia
IgnacioHeredia / rename_arxiv.py
Created January 2, 2023 11:55
Rename arxiv papers with their original title. You have to put and run this script in the same folder as the pdfs to be renamed.
#!/usr/bin/env python3
"""
Rename arxiv papers with their original title. You have to put and run this script in the same folder as the pdfs to be renamed.
Author: Ignacio Heredia
Date: October 2017
"""
import os
import requests
@IgnacioHeredia
IgnacioHeredia / sync-fork.yaml
Created August 9, 2022 07:45
Github Action to keep fork updated with upstream
# Script is (loosely) based on two references:
# * https://stackoverflow.com/questions/23793062/can-forks-be-synced-automatically-in-github
# * https://stackoverflow.com/questions/69918635/how-to-keep-all-branches-and-tags-in-sync-in-a-fork-or-mirror-repo
# [!] Note: Do not do a force push to not overwrite the .github/workflow/main.yml file.
# We are not using a predefined action (eg. [1]) to not go through the hassle of having to
# manage Github Personal Access Tokens for deephdc.
# [1]: https://github.com/repo-sync/github-sync
@IgnacioHeredia
IgnacioHeredia / zettlr.css
Last active January 29, 2024 08:36
CSS to make the Zettlr editor look prettier
/*
Use paired with Bielefeld theme in dark mode
See also: https://github.com/Zettlr/Zettlr/discussions/2863
*/
/* ----------------- */
/* Light mode styles */
/* ----------------- */
.CodeMirror .cm-quote {
@IgnacioHeredia
IgnacioHeredia / centered_subplots.py
Last active March 15, 2022 10:41
Modification of matplotlib plt.subplots(), useful when some subplots are empty. It returns a grid where the plots in the last row are centered.
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
def subplots_centered(nrows, ncols, figsize, nfigs):
"""
Modification of matplotlib plt.subplots(),
useful when some subplots are empty.
It returns a grid where the plots