Skip to content

Instantly share code, notes, and snippets.

@RaneWallin
RaneWallin / hello_epaper3.py
Last active February 2, 2024 14:03
Complete demo project for the Waveshare 2.7" HAT on Raspberry Pi
import sys # import sys
sys.path.insert(1, "./lib") # add the lib folder to sys so python can find the libraries
import epd2in7b # import the display drivers
from PIL import Image,ImageDraw,ImageFont # import the image libraries
import time
from gpiozero import Button # import the Button control from gpiozero
btn1 = Button(5) # assign each button to a variable
btn2 = Button(6) # by passing in the pin number
@konstantin-morenko
konstantin-morenko / list-categories-count.liquid
Last active January 21, 2021 14:49 — forked from Phlow/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category }}">{{ category | capitalize }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ tag[0] }}">{{ category[0] | capitalize }} ({{ category[1].size }})</a></li>