Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Working!

Sergio Delgado Quintero sdelquin

🎯
Working!
View GitHub Profile
@sdelquin
sdelquin / check_tools.py
Created Jul 22, 2021
Check tools from pylovepdf
View check_tools.py
import os
import sys
from prettyconf import config
from pylovepdf import ILovePdf
PUBLIC_KEY = config('ILOVEPDF_PUBLIC_KEY')
# tool names as described in https://github.com/AndyCyberSec/pylovepdf#tools
TOOLS = [
@sdelquin
sdelquin / load-custom-css.py
Last active May 25, 2021
Load custom CSS for Jupyter Notebook
View load-custom-css.py
from IPython.display import HTML
from pathlib import Path
css_rules = Path('custom.css').read_text()
HTML('<style>' + css_rules + '</style>')
@sdelquin
sdelquin / factorial.py
Created Jan 25, 2019
Factorial made in Python
View factorial.py
def recursive_factorial(n):
if n == 1:
return 1
return n * recursive_factorial(n - 1)
def iterative_factorial(n):
result = 1
for i in range(2, n+1):
result *= i
@sdelquin
sdelquin / rename.py
Created May 15, 2018
Watch a directory and rename created files with a timestamp
View rename.py
# pip install watchdog
# python3 rename.py <path>
import sys
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import datetime
import os