Skip to content

Instantly share code, notes, and snippets.

Avatar

Theo van der Sluijs tvdsluijs

View GitHub Profile
@tvdsluijs
tvdsluijs / bulk-export.yml
Created Jul 2, 2020
Screaming Frog -bulk-export list of names and filenames (when using command line)
View bulk-export.yml
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 Jul 2, 2020
Get text from Images with python and pytesseract
View img_ocr.py
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 Sep 16, 2019
For downloading one or multiple youtube video's
View downtube.py
"""
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 Jan 31, 2020
Import all you Markdown Jekyll files to Medium
View jekyll2medium.py
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 Jul 13, 2019
Change jekyll feature-img, image tag to image: paht: and image:
View feature2imagepath.py
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 Jun 20, 2019
Small python script to show exponential growth
View exponential_growth.py
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 Jun 11, 2019
Small script to get your energy data from the slimmemeterportal.nl
View slimmemeterportal.nl.py
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
Small class to create a Gauge with Matplotlib. Original code from https://github.com/nicolasfauchereau
View gauge.py
'''
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 Mar 29, 2019
Compress PDF files with python
View pdf_compressor.py
#!/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
@tvdsluijs
tvdsluijs / find_and_replace_in_files.py
Created Feb 26, 2019
Search and replace text within files within a folder.
View find_and_replace_in_files.py
'''
author: Pure Python
url: https://www.purepython.org
copyright: CC BY-NC 4.0
creation date: 26-02-2019
With this script you can search within a folder and files for some text and replace it with other text.
Extra install:
For the fun of it I used the Halo spinner package to show a nice progress spinner
You can’t perform that action at this time.