WordPress: How to create an iframe refresh button

Let’s say you have an interactive canvas loaded in an iframe and you want to have the ability to “clear” the canvas without reloading the entire page. This example was created using p5.js and the html was loaded into an iframe. After drawing on this canvas, it can be cleared by clicking the “Clear Canvas” … Continue reading WordPress: How to create an iframe refresh button

WordPress: Inject custom CSS to create borders around iframes and images

CSS can be used to style an iframe to give it a border with a drop shadow. For example: #iframe_drop_shadow { -moz-box-shadow: 4px 4px 14px #000; -webkit-box-shadow: 4px 4px 14px #000; box-shadow: 4px 4px 14px #000; } Then, in the tag that creates the iframe, reference this CSS using the tag id=”iframe_drop_shadow”. For example: <iframe … Continue reading WordPress: Inject custom CSS to create borders around iframes and images

WordPress: How to create a Table of Contents page with Python

What I wanted to create was a dynamic Table of Contents page where I could have a listing of all of my published articles, organized by category, and sorted such that categories with the most posts appear first, and the posts under each category are listed from most recent at the top to oldest at … Continue reading WordPress: How to create a Table of Contents page with Python

WordPress: How to use an iframe to pull in outside content

Here are instructions for using an iframe with wordpress.org websites. 1.  Download the iframe Plugin from here. iframe 2.  Use a shortcode in a post like this: Note: I added a space after the left bracket [ and before the right bracket ] in order to not trigger the shortcode in the below code example. … Continue reading WordPress: How to use an iframe to pull in outside content

Python on the web: How to get a list of all available Python modules

If you want to get a complete list of Python modules available on your web host, you can do so with the following code: #!/usr/bin/python import os print “Content-type: text/html\n\n”; print “<html><head></head>” print “<body bgcolor=’#ffffff’>” print “\n<BR><b>Available Modules:</b><BR>” # List all installed packages print ‘<ul>’ dist_list = [] for dist in __import__(‘pkg_resources’).working_set: dist_list.append(dist.project_name.replace(‘Python’, ”).strip()) dist_list … Continue reading Python on the web: How to get a list of all available Python modules