Recent blog posts
get_shortcode_regex() (GSR() from now on) is used to parse shortcodes from a post's text.
I was writing a filter to take the post text, parse the shortcodes, and modify them by adding an "id" parameter.
After I spent some time writing a regex to parse the shortcodes, I discovered GSR(). GSR() was better and more complete.
Now I just had to learn to use it - and there weren't any docs.
Let's Review How to Use Shortcodes
You've basically got five ways to use shortcodes:
Since the comments were closed, I'm noting here, that Python figured this out a while back.
Function parameters start with required positional parameters, followed by optional positional parameters, followed by named parameters.
In JS this would be:
I'm learning a lot from this excursion into Kindle publishing.
Technical books are higher-value products, so that's good. They don't have a big audience, which is bad.
Cookbooks are lower-value products, but take little time to write, and have a much larger audience.
On a lark, I got a marketing ebook and was told to write catchy headlines. Then I got another ebook about writing headlines. So, I'm going to be changing all the headlines on this site, save a few, just to see if it boosts the traffic coming into the site.
A lot of other books out there don't discuss selector specificity and the Cascade in enough detail. They don't talk about ways to organize your code, either. When you read this ebook, it'll make sense.
This script renames a directory full of XCF files so that the filename is derived from the first line of a layer named "caption".
I wrote this to enhance the file names for Koya Hand Crafts.
Originally from: 2007-09-26 15:17:44 -0700
This is a bit of code to add a floating box to your page that will let you switch stylesheets and fonts. I wrote it specifically to start trying out different "themes" and fonts, not to allow the end user to do these things. But the client will be using it to preview.
It's not fully parameterized, nor does it generate the HTML for the selects, so you'll need to hack the code.
Some of the notes here are really old, and use old practices. This is a rundown of contemporary practices circa 2016. I'm a few years behind, so, it's more like 2013 practices, but, there are still tutorials being written that don't use these better techniques. Get with the times.
Don't set up Apache. Instead use "php -S localhost:8000" to start a local server from the shell. The docroot will be in the current directory, and error logs go to the screen.
It took forever, but I finally hunkered down and learned some Python-Fu. It's really nice, especially being able to use Python's libraries, but, like programming Gimp in Scheme, it was kind of hard.
The most important thing, which I learned only after working at it three hours, is to use the "Browser..." tool in the Python console (in Gimp). This helps you find predefined commands to do all the expected operations. Use the "Apply" button to paste an example into the console.
I'm kind of bummed out. GoDaddy's free web page builder, InstantPage, isn't being given out with the domain anymore. I thought it was going to kill the website building business (meaning something I do for money) but the prospect of a nice page done in an hour or less, hosted for free, was just too awesome.
Maybe the free product was cannibalizing sales of their other products.
This is a small project that helps you set up a development environment for WordPress, and it's done with Vagrant and Ansible. Vagrant sets up the virtual machine, and Ansible provisions WordPress and its dependencies. It also brings in a theme, and a child theme that has a development environment.
I stumbled across this site, and decided to give it a try. Yeah, I don't know if it's even a legit service, but I decided to route ALL my mail through them.
Their price is 25c per email address per month, which is cheap if you have just one address. I, unfortunately, use four. If I decide to use MX Guarddog permanently, a couple of these will be going away because I'm that cheap.
You can get around this fee by putting a link to their service on your site. These are text links that you embed in your pages.
I'm having one of those mornings, where nothing works quite right.
I'm doing some writing in Pandoc, and the Markdown implementation doesn't have an "include" feature to pull in source code. After looking around, there are some tools that implement #include or !include, but there weren't quite what I wanted, so I wrote this in awk.