Create an inline website editor using contenteditable

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.

editor.js – a web-based WYSIWYG editor that outputs JSON

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.

Need Icons For a Website? Use FontAwesome!

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.

<script src="https://kit.fontawesome.com/8758af3809.js" crossorigin="anonymous"></script>

<i class="fas fa-car"></i>

Here’s a demo.

Grilled Corn Using Ninja Foodi Grill

So, I tried making grilled corn using the Ninja Foodi Grill and surprisingly, it came out really good!

Here’s the recipe.

Ingredients

  • Corn ears (make sure the kernels are big so you’ve got some meat to bite in to)
  • Salt
  • Pepper
  • Canola oil
  • Butter

Instructions

  1. Remove the husk (outer layers of the corn)
  2. Massage the kernels with canola oil
  3. Sprinkle salt and pepper
  4. Turn on Ninja Foodi Grill, click Grill button to Max setting, set time to 12 minutes, let preheat, wait till it says “Add food”, then put in the corn
  5. Set a timer for 6 minutes then turn the corn over
  6. When done, massage butter over the corn or melt butter in the microwave and baste the corn with the liquid butter

Prevent weeds from growing anywhere in your yard

As I’ve said before, weeds are notorious for finding ways of growing through weed fabric and along yard edges.

Middle of yard

To combat weeds from popping up in the middle of your landscape, lay cement board everywhere. Cement board is porous so water can still drain through it. For the areas between the cement boards, weeds will grow. To prevent this from happening, cut pond liner and place it where the cement board gaps are. Pond liner is very strong, UV-resistant, and almost impossible to tear. Traditional weed fabric may be marketed with the claim that it can prevent weeds but it can’t. Weeds still manage to come through. Plus, if you use weed fabric along edges where it’s exposed, it can degrade and easily tear as shown in the picture below.

Now I have to replace that weed fabric with pond liner like I did along a different fence.

Edges of yard

For edges, you can screw pressure-treated 2x4s to the cement edges using special screws and a drill bit for concrete. Just make sure to drill using the hammer drill mode.

If there is no room to drill a screw into the concrete, e.g. if the edge is near a fence, then you can drill 1/2-inch holes in the 2×4 using a 1/2″ spade bit and drive 12-inch long, 3/8-inch galvanized nails through the holes into the ground.

Cut some pond liner and staple it to the 2x4s. Don’t use traditional weed fabric. It will eventually fail and rip and weeds will come through it.

Hammer the large nails through the 2x4s and the pond liner into the ground along the edge of the concrete as shown below.

Allow some of the pond liner to extend beyond the end of the 2×4 so the next 2×4’s pond liner will overlap the first one and prevent weeds from growing in between the 2x4s.

Since 2x4s may not be perfectly straight, you can push them against the concrete edge using a clamp.

If the other side is a wood fence, you can simply staple some pond liner to the fence. In the picture below, the space between the concrete and the fence was narrow. I left a gap between the pond liner for drainage.

Easily cut cement board using a reciprocating saw. You can also use a utility knife or the WEN Electric Fiber Cement and Siding Shear, Variable Speed (3670).

In this case, I placed the cement board over the gaps between the pond liner to prevent weeds from growing along the gap.

You can then put rocks like I did pictured below.

There will still be a small gap between the concrete edge and the 2x4s. Fill that cap with concrete control joint sealant. I like Sikaflex Self-Leveling Sealant. Learn more.

For the rocks, I used ¾-inch ginger rocks / Sonoma gold rocks.

Shakshouka / Menemen Recipe

Moroccan Shakshouka and Turkish Menemen are very similar. Here’s my version of these dishes.

Ingredients

  • 3 eggs
  • 1 8oz can of fire-roasted diced tomatoes (Target / FoodMaxx)
  • 2/3 cup frozen diced onions (Smart n Final)
  • 1//4 cup cilantro for garnish
  • 2 tbsp wet minced garlic
  • 10 tbsp olive oil
  • Smoked paprika (not regular paprika)
  • Salt and pepper
  • 2 tbsp tomato paste (optional)
  • Pita bread

Instructions

  1. Pour olive oil in medium 10″ pan on medium-high heat
  2. Fry onions and garlic until slight brown
  3. Pour in diced tomatoes and sprinkle in smoked paprika, salt and pepper to taste (optionally, add tomato paste)
  4. When mixture is not too runny, make 3 deep dimples in the pan and crack each egg into them
  5. Cover and poach on low heat until egg white changes from translucent to white. Turn off heat so that egg yolk is still runny.
  6. Garnish with cilantro
  7. Cut some pita bread in quarters and warm for 15 seconds in microwave
  8. Eat
Fry diced tomatoes and garlic in olive oil
Cook fire-roasted tomatoes with smoked paprika, salt and pepper and optionally tomato paste
Make dimple in mixture
Crack eggs into dimples without breaking yolk
Cover and poach eggs on low heat until egg whites are white, not transparent
Like this
Garnish with cilantro and warm up pita quarters
Eat directly from pan

Steak Recipe Using Ninja Foodi Smart Grill

So, I just got the Ninja Foodi Smart Indoor Grill which doubles as an air fryer and mini oven. I have another cheaper indoor grill but tends to produce smoke and always triggers my smoke sensor. So far, though the Ninja grill is larger, it hasn’t emitted any smoke nor triggered my smoke sensor and produces better grill results.

Here’s how to make steak using it.

Ingredients for Marinade

Preparation

  1. Get your steak (minimum 1″ thick and preferably from Costco).
  2. Put that steak in a ziploc bag.
  3. Mix water and sauce and pour into the ziploc bag.
  4. Zip the bag and turn a few times and let marinate for 1 to 8 hours.

Cooking Instructions

  1. Insert thermometer into middle of side of steak such that the tip is at the center of the thickest part.
  2. Turn on the Ninja grill by pushing the grill button.
  3. Click the left up/down arrows to choose a doneness level. I like medium rare.
  4. Push the thermometer / preset button to start the preheat phase
  5. Sprinkle salt on both sides of the meat.
  6. When preheating is done, it will beep and tell you to insert the steak. Do so.
  7. Sometime later, it will beep and tell you to flip the steak. Do so, preferably using silicone-tipped tongs.
  8. Sometime later, it will be done and tell you to get the steak out. Do so and wait 5 minutes before enjoying.

Grill Vegetables (optional)

To complement the steak, you can grill some vegetables in the Ninja grill also. Here are the veggies that grill well.

  • Asparagus
  • Zucchini
  • Tomatoes
  • Onions
  • Bell pepper
  • Jalapeno peppers
  • Tomatillo peppers
  • Corn

Instructions

  1. Cut vegetable in half or in slices.
  2. Remove spicy seeds from peppers.
  3. Slather with / baste in oil.
  4. Sprinkle coarse salt and pepper.
  5. Turn on Ninja grill
  6. Push grill button
  7. Push right up/down to set the time to 6 minutes
  8. Push thermometer / preset button twice to skip preheating
  9. Put veggies in grill
  10. The grill will beep when done.

The Quran Doesn’t Support a Strictly Vegetarian Diet

The vegetarian diet involves abstaining from eating meat, fish and poultry. Some Muslims are vegetarian, though not necessarily because of religious belief. Interestingly, the Quran does not support a strictly vegetarian diet. Consider the following verses which all support eating meat.

Verse 2:57

Eat manna and quail.

وَظَلَّلْنَا عَلَيْكُمُ ٱلْغَمَامَ وَأَنزَلْنَا عَلَيْكُمُ ٱلْمَنَّ وَٱلسَّلْوَىٰ ۖ كُلُوا۟ مِن طَيِّبَـٰتِ مَا رَزَقْنَـٰكُمْ ۖ وَمَا ظَلَمُونَا وَلَـٰكِن كَانُوٓا۟ أَنفُسَهُمْ يَظْلِمُونَ
And We shaded you with clouds and sent down to you manna and quails, [saying], “Eat from the good things with which We have provided you.” And they wronged Us not – but they were [only] wronging themselves. (2:57)

Verse 7:160

Eat manna and quail.

وَقَطَّعْنَـٰهُمُ ٱثْنَتَىْ عَشْرَةَ أَسْبَاطًا أُمَمًا ۚ وَأَوْحَيْنَآ إِلَىٰ مُوسَىٰٓ إِذِ ٱسْتَسْقَىٰهُ قَوْمُهُۥٓ أَنِ ٱضْرِب بِّعَصَاكَ ٱلْحَجَرَ ۖ فَٱنۢبَجَسَتْ مِنْهُ ٱثْنَتَا عَشْرَةَ عَيْنًا ۖ قَدْ عَلِمَ كُلُّ أُنَاسٍ مَّشْرَبَهُمْ ۚ وَظَلَّلْنَا عَلَيْهِمُ ٱلْغَمَـٰمَ وَأَنزَلْنَا عَلَيْهِمُ ٱلْمَنَّ وَٱلسَّلْوَىٰ ۖ كُلُوا۟ مِن طَيِّبَـٰتِ مَا رَزَقْنَـٰكُمْ ۚ وَمَا ظَلَمُونَا وَلَـٰكِن كَانُوٓا۟ أَنفُسَهُمْ يَظْلِمُونَ
And We divided them into twelve descendant tribes1 [as distinct] nations. And We inspired to Moses when his people implored him for water, “Strike with your staff the stone,” and there gushed forth from it twelve springs. Every people [i.e., tribe] knew its watering place. And We shaded them with clouds and sent down upon them manna and quails, [saying], “Eat from the good things with which We have provided you.” And they wronged Us not, but they were [only] wronging themselves. (7:160)

Verse 5:3

Eat animals you slaughter.

حُرِّمَتْ عَلَيْكُمُ ٱلْمَيْتَةُ وَٱلدَّمُ وَلَحْمُ ٱلْخِنزِيرِ وَمَآ أُهِلَّ لِغَيْرِ ٱللَّهِ بِهِۦ وَٱلْمُنْخَنِقَةُ وَٱلْمَوْقُوذَةُ وَٱلْمُتَرَدِّيَةُ وَٱلنَّطِيحَةُ وَمَآ أَكَلَ ٱلسَّبُعُ إِلَّا مَا ذَكَّيْتُمْ وَمَا ذُبِحَ عَلَى ٱلنُّصُبِ وَأَن تَسْتَقْسِمُوا۟ بِٱلْأَزْلَـٰمِ ۚ ذَٰلِكُمْ فِسْقٌ ۗ ٱلْيَوْمَ يَئِسَ ٱلَّذِينَ كَفَرُوا۟ مِن دِينِكُمْ فَلَا تَخْشَوْهُمْ وَٱخْشَوْنِ ۚ ٱلْيَوْمَ أَكْمَلْتُ لَكُمْ دِينَكُمْ وَأَتْمَمْتُ عَلَيْكُمْ نِعْمَتِى وَرَضِيتُ لَكُمُ ٱلْإِسْلَـٰمَ دِينًا ۚ فَمَنِ ٱضْطُرَّ فِى مَخْمَصَةٍ غَيْرَ مُتَجَانِفٍ لِّإِثْمٍ ۙ فَإِنَّ ٱللَّهَ غَفُورٌ رَّحِيمٌ
Prohibited to you are dead animals,1 blood, the flesh of swine, and that which has been dedicated to other than Allah, and [those animals] killed by strangling or by a violent blow or by a head-long fall or by the goring of horns, and those from which a wild animal has eaten, except what you [are able to] slaughter [before its death], and those which are sacrificed on stone altars,2 and [prohibited is] that you seek decision through divining arrows. That is grave disobedience. This day those who disbelieve have despaired of [defeating] your religion; so fear them not, but fear Me. This day I have perfected for you your religion and completed My favor upon you and have approved for you Islām as religion. But whoever is forced by severe hunger with no inclination to sin – then indeed, Allah is Forgiving and Merciful. (5:3)

Verse 5:4

Eat animals caught by trained hunting animals.

يَسْـَٔلُونَكَ مَاذَآ أُحِلَّ لَهُمْ ۖ قُلْ أُحِلَّ لَكُمُ ٱلطَّيِّبَـٰتُ ۙ وَمَا عَلَّمْتُم مِّنَ ٱلْجَوَارِحِ مُكَلِّبِينَ تُعَلِّمُونَهُنَّ مِمَّا عَلَّمَكُمُ ٱللَّهُ ۖ فَكُلُوا۟ مِمَّآ أَمْسَكْنَ عَلَيْكُمْ وَٱذْكُرُوا۟ ٱسْمَ ٱللَّهِ عَلَيْهِ ۖ وَٱتَّقُوا۟ ٱللَّهَ ۚ إِنَّ ٱللَّهَ سَرِيعُ ٱلْحِسَابِ
They ask you, [O Muḥammad], what has been made lawful for them. Say, “Lawful for you are [all] good foods and [game caught by] what you have trained of hunting animals which you train as Allah has taught you. So eat of what they catch for you, and mention the name of Allah upon it, and fear Allah.” Indeed, Allah is swift in account. (5:4)

Verse 6:118

Eat meat.

فَكُلُوا۟ مِمَّا ذُكِرَ ٱسْمُ ٱللَّهِ عَلَيْهِ إِن كُنتُم بِـَٔايَـٰتِهِۦ مُؤْمِنِينَ
So eat of that [meat] upon which the name of Allah has been mentioned,1 if you are believers in His verses [i.e., revealed law]. (6:118)

Verse 6:142

Eat livestock.

وَمِنَ ٱلْأَنْعَـٰمِ حَمُولَةً وَفَرْشًا ۚ كُلُوا۟ مِمَّا رَزَقَكُمُ ٱللَّهُ وَلَا تَتَّبِعُوا۟ خُطُوَٰتِ ٱلشَّيْطَـٰنِ ۚ إِنَّهُۥ لَكُمْ عَدُوٌّ مُّبِينٌ
And of the grazing livestock are carriers [of burdens] and those [too] small. Eat of what Allah has provided for you and do not follow the footsteps of Satan.1 Indeed, he is to you a clear enemy. (6:142)

Verse 16:5

Eat livestock.

وَٱلْأَنْعَـٰمَ خَلَقَهَا ۗ لَكُمْ فِيهَا دِفْءٌ وَمَنَـٰفِعُ وَمِنْهَا تَأْكُلُونَ
And the grazing livestock He has created for you; in them is warmth1 and [numerous] benefits, and from them you eat. (16:5)

Verse 16:14

Eat seafood.

وَهُوَ ٱلَّذِى سَخَّرَ ٱلْبَحْرَ لِتَأْكُلُوا۟ مِنْهُ لَحْمًا طَرِيًّا وَتَسْتَخْرِجُوا۟ مِنْهُ حِلْيَةً تَلْبَسُونَهَا وَتَرَى ٱلْفُلْكَ مَوَاخِرَ فِيهِ وَلِتَبْتَغُوا۟ مِن فَضْلِهِۦ وَلَعَلَّكُمْ تَشْكُرُونَ
And it is He who subjected the sea for you to eat from it tender meat and to extract from it ornaments which you wear. And you see the ships plowing through it, and [He subjected it] that you may seek of His bounty; and perhaps you will be grateful. (16:14)

Verse 35:12

Eat seafood.

وَمَا يَسْتَوِى ٱلْبَحْرَانِ هَـٰذَا عَذْبٌ فُرَاتٌ سَآئِغٌ شَرَابُهُۥ وَهَـٰذَا مِلْحٌ أُجَاجٌ ۖ وَمِن كُلٍّ تَأْكُلُونَ لَحْمًا طَرِيًّا وَتَسْتَخْرِجُونَ حِلْيَةً تَلْبَسُونَهَا ۖ وَتَرَى ٱلْفُلْكَ فِيهِ مَوَاخِرَ لِتَبْتَغُوا۟ مِن فَضْلِهِۦ وَلَعَلَّكُمْ تَشْكُرُونَ
And not alike are the two seas [i.e., bodies of water]. One is fresh and sweet, palatable for drinking, and one is salty and bitter. And from each you eat tender meat and extract ornaments which you wear, and you see the ships plowing through [them] that you might seek of His bounty; and perhaps you will be grateful. (35:12)

Verse 22:28

Eat animals.

لِّيَشْهَدُوا۟ مَنَـٰفِعَ لَهُمْ وَيَذْكُرُوا۟ ٱسْمَ ٱللَّهِ فِىٓ أَيَّامٍ مَّعْلُومَـٰتٍ عَلَىٰ مَا رَزَقَهُم مِّنۢ بَهِيمَةِ ٱلْأَنْعَـٰمِ ۖ فَكُلُوا۟ مِنْهَا وَأَطْعِمُوا۟ ٱلْبَآئِسَ ٱلْفَقِيرَ
That they may witness [i.e., attend] benefits for themselves and mention the name of Allah on known [i.e., specific] days over what He has provided for them of [sacrificial] animals.1 So eat of them and feed the miserable and poor. (22:28)

Verse 22:36

Eat camels and cattle.

وَٱلْبُدْنَ جَعَلْنَـٰهَا لَكُم مِّن شَعَـٰٓئِرِ ٱللَّهِ لَكُمْ فِيهَا خَيْرٌ ۖ فَٱذْكُرُوا۟ ٱسْمَ ٱللَّهِ عَلَيْهَا صَوَآفَّ ۖ فَإِذَا وَجَبَتْ جُنُوبُهَا فَكُلُوا۟ مِنْهَا وَأَطْعِمُوا۟ ٱلْقَانِعَ وَٱلْمُعْتَرَّ ۚ كَذَٰلِكَ سَخَّرْنَـٰهَا لَكُمْ لَعَلَّكُمْ تَشْكُرُونَ
And the camels and cattle We have appointed for you as among the symbols [i.e., rites] of Allah; for you therein is good. So mention the name of Allah upon them when lined up [for sacrifice]; and when they are [lifeless] on their sides, then eat from them and feed the needy [who does not seek aid] and the beggar. Thus have We subjected them to you that you may be grateful. (22:36)

Verse 23:21

Eat livestock and animal byproducts.

وَإِنَّ لَكُمْ فِى ٱلْأَنْعَـٰمِ لَعِبْرَةً ۖ نُّسْقِيكُم مِّمَّا فِى بُطُونِهَا وَلَكُمْ فِيهَا مَنَـٰفِعُ كَثِيرَةٌ وَمِنْهَا تَأْكُلُونَ
And indeed, for you in livestock is a lesson. We give you drink from that which is in their bellies, and for you in them are numerous benefits, and from them you eat. (23:21)

Verse 36:72

Eat some animals.

وَذَلَّلْنَـٰهَا لَهُمْ فَمِنْهَا رَكُوبُهُمْ وَمِنْهَا يَأْكُلُونَ
And We have tamed them for them, so some of them they ride, and some of them they eat. (36:72)

Verse 40:79

Eat some grazing animals.

ٱللَّهُ ٱلَّذِى جَعَلَ لَكُمُ ٱلْأَنْعَـٰمَ لِتَرْكَبُوا۟ مِنْهَا وَمِنْهَا تَأْكُلُونَ
It is Allah who made for you the grazing animals upon which you ride, and some of them you eat. (2:57)

Verse 51:24-27

Prophet Abraham offered calf meat to his guests.

هَلْ أَتَىٰكَ حَدِيثُ ضَيْفِ إِبْرَٰهِيمَ ٱلْمُكْرَمِينَ إِذْ دَخَلُوا۟ عَلَيْهِ فَقَالُوا۟ سَلَـٰمًا ۖ قَالَ سَلَـٰمٌ قَوْمٌ مُّنكَرُونَ فَرَاغَ إِلَىٰٓ أَهْلِهِۦ فَجَآءَ بِعِجْلٍ سَمِينٍ فَقَرَّبَهُۥٓ إِلَيْهِمْ قَالَ أَلَا تَأْكُلُونَ
Has there reached you the story of the honored guests of Abraham?1 – When they entered upon him and said, “[We greet you with] peace.” He answered, “[And upon you] peace; [you are] a people unknown.” Then he went to his family and came with a fat [roasted] calf. And placed it near them; he said, “Will you not eat?” (51:24-27)

Related articles

Tips for Visiting Istanbul

Here’s a custom Google Map with markers of interesting places to visit in Istanbul.

Food

Baklava

Karaköy Güllüoğlu
Karaköy, Rıhtım Cad. Katlı Otopark Altı No: 3-4 Istanbul / Turkey T: +90 212 293 09 10 Google Maps

Carrot Shaped Baklava with Ice Cream

Iskendar Kabab

Sırevi
Alemdar, 34122 Fatih/İstanbul, Turkey Google Maps

Beef Pide

Guvenc Konyali

Ankara Cad, Hocapaşa Hamamı Sk. No: 4, 34110 Fatih, Turkey Google Maps

Tours

Aya Sofia and Blue Mosque Walking Tour

Grand Bazaar Walking Tour

Galata Bridge – Karakoy Walking Tour

Istiklal Cadessi Walking Tour

Süleymaniye Mosque to Spice Market Walking Tour

Quickly Create Photo Slideshow Video

This tutorial uses Corel VideoStudio Pro.

1. Add photos to project

Sort the photos as desired, usually by date, so they appear in chronological order.

2. Select and drag photos to video track

All photos will be added to the video track

3. Change duration of each photo

If the duration of each photo is too short or long, select all photos, right click and click on “Change Photo Duration …”. This will change the duration for each and all photos.

4. Add a transition effect

Choose a transition (a simple “crossfade” is the best”), right click and click on “Apply current effect to video track”.

This will result in the transition being applied to all photos.

5. Add Pan and Zoom effect

Select all photos, right click and click on “Auto Pan & Zoom”.

6. Drag audio file to music track

You can find some background music from Sound Cloud.

7. Add intro slide

Click “Instant Project” icon, click on “Beginning”, choose a template, right click and click on “Add at the beginning”.

8. Edit intro slide

Since the intro slide is a template, you will see placeholder content.

Drag a photo to the placeholder clip and hold “Ctrl” to replace the clip. This will cause the photo to be formatted to fit the template.

Double-click the text clip to edit the text of the intro template.

9. Add end slide

This process is the same as for adding the intro slide but click on “Add at the end” instead.

10. Add text to some photos

Click “Title” and then pick a title template. The one with a semi-transparent background is good. Drag it to the Title track where you want the text to appear.

11. Change text and background color

This title template animates the text.

Convert it to a simple fade in and out by clicking on the “Attribute” tab in the Options Panel for the title, click on “Attribute” tab, click on “Animation”, and disable animation by unchecking the “Apply” checkbox.

The background of the text is too light so let’s darken that semi-transparent bar. Double-click on the title clip and in the Options Panel, click the “Edit” tab, and click on the black color in the Text Backdrop context menu as shown in the screenshot below.

Double-click on the title clip again and edit the text.

12. Add more text

Copy and paste the text clip to other photo clips and edit the text.

13. Render video

Click the “Share” tab, choose a setting, and click “Start” button.