After years of requests (unfortunately unanswered due to lack of time), last year I made public the code for the contract generator.
FTP Contract
Posted in Databaseless PHP onA signable contract that lives in a single file that you can host on your own domain.
How it works:
- You create a PHP contract and upload it on your server.
- Someone else signs it.
- The PHP contract deletes itself from your server and leaves beind a static HTML contract.
- View Demo
- View on GitHub (+350 ⭐️’s and +40 🔱’s)
- Generate a new contract
Signature to PNG
Posted in CodePen Experiments onThis neat little tool can be used in the browser to convert an inputed (graphical) signature into base64 data.
See the Pen Signature-to-PNG by Stefan Matei (@nonsalant) on CodePen.
Links to Footnotes
Posted in CodePen Experiments onTurn all links that have titles into footnotes. The titles become the footnote descriptions for the links.
See the Pen Links-to-Footnotes by Stefan Matei (@nonsalant) on CodePen.
Readers who are actually interested in what you’re linking to can still navigate to those links but it takes them an extra click.
Limit Requests in PHP
Posted in Databaseless PHP onThis is the story of many page requests in a short amount of time. Over 500 requests from the same IP in under 10 seconds. They all pinged the TimThumb script (a thumbnail generator, very popular among WordPress themes and plugins) asking it for resized, uncached images. The fact that this was done in one go saturated 16GB of RAM on the server and stopped other processes running, thus crashing the server.
The client was unhappy with their site being offline for the past day and a half (they were in fact losing business while being offline) and in reply the host expressed yet more serious concerns:
Correct My Headings
Posted in WordPress onIf your subheadings appear on archive pages, they need to start from H3 (because H2 tags are used by the post titles on archive pages). This plugin dynamically corrects subheadings before they are displayed on your site — for SEO and semantic markup purposes. Depending on how you use headings in the text of your posts (you could have them starting from the H2 level or from the H3 level) you will have a couple of options to choose from in the plugin’s settings page.
This plugin does not make any changes to your database: the subheadings will only be displayed differently on the front-end site. If you disable the plugin or decide to uninstall it everything will turn back to normal.
To install it type “correct my headings” and click the Search Plugins button in your WP Dashboard or:
- download this plugin from the WordPress Plugin Directory 📂
Password protected area in WordPress
Posted in WordPress onIf you ever need to set up a simple password protected area in WordPress, these snippets and plugins might come in handy when you’re hacking through your theme.
I believe this would be the logical approach: you create a main password protected page for your private section and then you create a bunch of child pages under that page. This way you’ll be using native WordPress functionality (page organization and page visibility) for most of your private section.
But you may find that a couple of patches will be in order.
Photoshop Tutorial: Create an old map of your area
Posted in Uncategorized on🗓 Originally published in 2008, on vileworks.com/blog
Put your city on the map in 4 layers. Create an artistic old map of your area. Here’s what you should be achieving:
Step 1: Getting the actual map
Go to Google Maps, find your area and zoom in to a desired level—I went in somewhere between City and Street view in some area in Bucharest, Romania but you can also do a Country view.
Update: Simon suggests in a comment below that to avoid any legal implications in using a screen capture from Google or Yahoo Maps in your artwork, you should rather go with an open map provider such as openstreetmap.org.
Hit the PrintScreen key, go in Photoshop and paste it in a new document and then Crop (C key) the image keeping only the desired part. Use the Patch Tool or the Healing Brush Tool to remove the center cross.
Step 2: Applying the old paper texture to give it a vintage look
For the second step you need an old grunge paper texture. I used this free image from cgtextures. Paste it on a new layer above the map and set the blending mode to Multiply. If your image turns out too dark, select the paper layer and go to Image > Adjustment > Brightness/Contrast and set set the brightness to a higher value (I didn’t need to). You may also need to adjust its size and position.