Skip to content

Instantly share code, notes, and snippets.

@Moving-Electrons
Moving-Electrons / pelican_injection-gist.py
Last active March 20, 2018 10:41
Python 3.5 script for processing files exported from Ulysses in either .md format or .zip format (including images) to be used on Pelican static site generator. The script inserts HTML code, moves images to the appropriate folders in Pelican and expands markdown image links accordingly. Visit www.movingelectrons.net for more info.
import sys
import re
import os
import zipfile
import shutil
# Constant Definition
# -------------------
@Moving-Electrons
Moving-Electrons / bear_to_pelican.py
Last active January 8, 2019 00:15
Python 3 script for exporting Bear App documents to Pelican Site Generator. The script takes a zip file (argument) containing the exported files in Markdown format from Bear App (i.e. MD file and images), reformats the MD adequately and moves the files to Pelican content folders. More information on www.movingelectrons.net
import sys
import re
import os
import zipfile
import shutil
# Constant Definition
# -------------------
# Path to be prepended to image links in markdown file, like so: ![](IMAGE_LINK<image_filename>).
@Moving-Electrons
Moving-Electrons / ambient_conditions.py
Created January 16, 2018 00:31
This script check ambient conditions every 2 minutes and updates an LED matrix graph accordingly. It uses a Raspberry Pi Zero W, Adafruit VCNL4010 proximity sensor and a Sense HAT. More info can be found at www.movingelectrons.net.
#!/usr/bin/python3
# Import the VCNL40xx module.
import Adafruit_VCNL40xx
from sense_hat import SenseHat
import time
import threading
import subprocess
# Create a VCNL4010 instance.