Skip to content

Instantly share code, notes, and snippets.

View tvdsluijs's full-sized avatar

Theo van der Sluijs tvdsluijs

View GitHub Profile
@tvdsluijs
tvdsluijs / sudoku_solve.py
Created September 25, 2020 14:54
Sudoku solver
# SuDoKu Solver in Python
# With special thanks to Computerphile (Danke Thorsten!)
# https://www.youtube.com/watch?v=G_UYXzGuqvM FUN TO WATH
# Make a list of each row of Sudoku numbers, empty = 0
# Put each list (row) in a list and run!
import sys
@tvdsluijs
tvdsluijs / bulk-export.yml
Created July 2, 2020 12:25
Screaming Frog -bulk-export list of names and filenames (when using command line)
bulk_exports:
-
file: all_inlinks.csv
name: All Inlinks
-
file: all_outlinks.csv
name: All Outlinks
-
file: queued_urls.csv
name: Queued URLs
@tvdsluijs
tvdsluijs / img_ocr.py
Created July 2, 2020 12:10
Get text from Images with python and pytesseract
import sys
import pytesseract
from pathlib import Path
from glob import glob
from os.path import join
class ImageOcr:
def __init__(self, my_path: Path = None):
@tvdsluijs
tvdsluijs / downtube.py
Created September 16, 2019 18:04
For downloading one or multiple youtube video's
"""
Author : Theo van der Sluijs
License: MIT
Version: 1.0
V-Date: 16 sept 2019
email: theo@vandersluijs.nl
installation:
create a folder called : youtube
install pytube: pip install pytube
@tvdsluijs
tvdsluijs / jekyll2medium.py
Last active January 31, 2020 07:39
Import all you Markdown Jekyll files to Medium
import requests
import json
import os
import re
import yaml
class ImportMDs:
def __init__(self, m_token=None, git_username=None):
try:
@tvdsluijs
tvdsluijs / feature2imagepath.py
Created July 13, 2019 18:56
Change jekyll feature-img, image tag to image: paht: and image:
import re
import os
from tqdm import tqdm
class Feature2ImagePath:
def __init__(self):
self.my_file = None
self.backup_file = None
self.file_data = None
@tvdsluijs
tvdsluijs / exponential_growth.py
Created June 20, 2019 13:28
Small python script to show exponential growth
import locale
import math
import tableprint as tp
locale.setlocale(locale.LC_ALL, "")
class Expo_Growth:
def __init__(self, start=0, stop=10, words=True):
@tvdsluijs
tvdsluijs / slimmemeterportal.nl.py
Last active April 19, 2021 07:43
Small script to get your energy data from the slimmemeterportal.nl
import requests
import calendar
import time
import datetime
from bs4 import BeautifulSoup
username = "" # fill in your slimmemeterportal username
password = "" # fill in your password
start_year = "" # fill in the year your started measurements
@tvdsluijs
tvdsluijs / gauge.py
Created May 6, 2019 06:48
Small class to create a Gauge with Matplotlib. Original code from https://github.com/nicolasfauchereau
'''
Small class to create a Gauge with Matplotlib
Original code from
http://nicolasfauchereau.github.io/climatecode/posts/drawing-a-gauge-with-matplotlib/
https://github.com/nicolasfauchereau
He did all the work, I just created a Class out of it.
'''
@tvdsluijs
tvdsluijs / pdf_compressor.py
Created March 29, 2019 15:02
Compress PDF files with python
#!/usr/bin/env python3
"""
author: Pure Python
url: https://www.purepython.org
copyright: CC BY-NC 4.0
Forked date: 2018-01-07 / First version MIT license -- free to use as you want, cheers.
Original Author: Sylvain Carlioz, 6/03/2017