Many, if not most, web forms are backed by a database. But what if you just need a simple data store, like a JSON file, and you want to quickly and easily provide users with a user-friendly web form to make updates to the JSON data. JSON Editor takes a JSON Schema and uses it to generate an HTML form.
The generated JSON output can then be used by a templating language like Handlebars for building a web page.
JSON Editor supports many options including the ability to quickly style a form using CSS frameworks like Bootstrap.
JSON Schema also supports validation so you can ensure your users are not submitting invalid data. For security reasons, this solution may not be good in a production environment by non-trustworthy people but it could work well in a secure, internal environment among coworkers.
Let’s say you have a website and you’re tired of making constant updates to some portion of oft-changing content, e.g. a conference agenda. It would be nice to offload this tedious work to a content owner who so often makes typos. But this content owner is non-technical and is a visual person. They need a WYSIWYG editor that would allow them to make changes directly on what it is that they want to edit, not directly in a database or something cryptic like a JSON file.
HTML5 supports the contenteditable attribute which makes any element editable. In the screenshot below, on a part of the byline is made editable.
Simple add the attribute “contenteditable=true” to the tag that wraps the text you want to make editable.
<p>Last Edited by <span id="author" contenteditable="true">Monty Shokeen</span>
</p>
When the content owner clicks on the text to editor, a black outline appears making it look like a form field.
The contenteditable attribute can be added to as many HTML elements as you want. Here is a live example showing three different editable fields with changes saved to local storage. Here’s an example showing how you can save the changes in JSON format and post it to a URL endpoint using AJAX or Fetch.
Many web developers are familiar with online editors like TinyCME. If you’ve edited a blog post in WordPress using the classic editor, then you know what I mean.
The problem with this type of editor is it’s too easy to accidentally output garbage HTML. WordPress has switched to offering a block style editor.
If you need to create a similar editor for your web project, editor.js offers inline block-style editing and it outputs clean data in json format.
Here’s a screenshot of example JSON output which can then be used with
This JSON data can then be used with a templating language like Handlebars to build web pages.
Icons make a big difference in the look of a website. When placed beside text links, they make the links stand out. They can be used to replace text links, especially on mobile. They accompany text to make boring, text heavy pages easier to read. But, finding icons or creating them can be difficult. FontAwesome solves this by offering thousands of icons that are easily searchable. If I search for car, here’s what I see.
To use an icon, e.g. of a car, just paste this HTML code.
Have you ever needed to do search and replace multiple times against the same file or set of files. If so, the Batch Replacer extension for VisualStudio Code makes this very simple.
Open a folder or file in VisualStudio Code
Create a new file (no need to save it) and enter some search and replace instructions, e.g.
In the example above, I want 3 different replacements done in the order shown and I only want the replacements done to a specific file. The “in” command is followed by the path of the file relative to the root of the workspace open in VS Code. If the file is open, you can get it by right clicking on its tab and selecting “Copy relative path”.
3. Execute the replacer script
To run the batch replacements, you active tab must be the tab containing your replacement instructions. Then, hit CTRL+SHIFT+P -> Batch Replace. A status window will appear in the bottom right corner telling you how many files have been modified. If you want to batch replace across all files in your workspace, don’t include the “in” instruction.
A few years ago I tried a product called Leave-in Hair Treatment with Argan Oil by HSI Professional. It came in a red box and bottle.
You just dab a little in the palm of your hand and massage it through your hair and it instantly makes your hair look and feel better. The ingredients are
Unsurprisingly, it got many good reviews on Amazon.
Unfortunately, this product has been replaced with a similar but slightly different product. It’s good but definitely not as good as the original formula.
To understand the difference and find products that are just as good, if not better, here is a list of products that have similar ingredients. Note that the percent amount of each ingredient is in descending order.
Phenyl Trimethicone reduces the tendency of finished products to generate foam when shaken. It also enhances the appearance and feel of hair, by increasing hair body, suppleness, or sheen, or by improving the texture of hair that has been damaged physically or by chemical treatment. Phenyl Trimethicone slows the loss of water from the skin by forming a barrier on the skin’s surface.
Keratin Amino Acids
Used for conditioning, moisturizing, known to make hair glossy, give it more body, and also for its marketing appeal (natural ingredient as well as hair is made from this). It’s a strong humectant, and pulls water into the hair.
Peg-4 Laurate, Peg-4 Dilaurate
They also clean the skin and hair by helping water to mix with oil and dirt so that they can be rinsed away.
Lodopropynyl Butylcarbamate, Phenoxyethanol
Prevents or retards bacterial growth, thereby protecting cosmetics and personal-care products from spoilage.
Creating a time lapse video is great for quickly showing changes that happen over a long period of time, e.g. the sky changing from day to night. I recently made a time lapse video of a pergola construction project using an Android app called Framelapse. It’s a very simple app which takes pictures at a user-specified interval over a set period of time or until you stop recording. What’s great is this method doesn’t fill up your phone by taking an actual video at the normal frame rate of 30 frames per second. For my first timelapse video, I chose a frame interval of 4 seconds. When I stopped recording, the timelapse video was instantly done and available in my Google Photos app and backed up to Google Photos in the cloud. I added some background music and I was done. Here’s the final video.
I’ve decided to move move and back up files files in the cloud. This includes moving all photos to Google Photos. Apparently, I had many duplicate photos in different folders that needed to be reorganized and deduped. Fortunately, CCCleaner makes finding and duplicating files of any time free, safe and easy. As you can see in the screenshot below, you can compare files and mark which ones to remove before removing them. There are many filters and controls so you can customize the search.
Testing HTTP connections and Rest APIs can easily be done using Postman. This handy tool allows you to provide HTTP headers, among many other things, to test connections and view responses.
Here’s a test of querying a Rest API from restdb.io. The query URL is https://testdb-cd69.restdb.io/rest/people. For authentication, an HTTP header called “x-apikey” is provided with its value (redacted). The response from the call is in the body panel in JSON format.