Latest posts

Browse topics

How To Fix Drupal AMP Error with Google Analytics

AMP for Drupal is a really powerful module, that can give your Drupal-powered website an impressive website traffic boost. But it will only work if there are no AMP-related issues - like Custom Javascript error from the Google Analytics module. 

I have been using Drupal AMP since 2016 or 2017 but stopped using it after upgrading my Drupal version from 7 to 9, as there were some bugs with the Drupal AMP module - it just didn't work.  

At the end of 2022, I decided to fix it and get AMP back for Drupal - it took me several days and nights, a lot of clean state servers, MySQL dumps.. but in the end, turned out just a line of code in amp module. Victory, I thought, when noticed ?amp pages working out. Just a few days later I noticed that despite ?amp being up and running it is far from perfect - there was zillions of errors and AMP was just not valid.

turned out I didn't have enabled (or built) an AMP theme. Which I did. Then fixed some minor things with the Advanced Aggregation Module, till was left with the last error standing - custom Javascript from Google.

After several hours of research, I found a working solution (Drupal 9.4 and AMP 8.3.50) 

it involved enabling the Bartik AMP theme and adding the following code to the bartik_amp.theme file

function my_theme_preprocess_html(&$variables) {
  foreach ($variables['page']['#attached']['html_head'] as $key => $value) {
    // Remove any other scripts that are being attached to the page.
    if ($value[0]['#tag'] == 'script' && (!isset($value[0]['#attributes']['type']) || $value[0]['#attributes']['type'] != 'application/ld+json')) {
      unset($variables['page']['#attached']['html_head'][$key]);
    }
  }
}

Warning: this is not part of bartik_amp, hence the "my_theme" prefix in the code sample; it must be adapted to your particular theme machine name. Also, if using the snippet for adjusting AMP Toolbar classes (see below), make sure to put it all under a single "my_theme_preprocess_html" function.

here is a full working bartik_amp.theme file

<?php

 

use Drupal\Core\Template\Attribute;

 

/**

* Implements hook_library_info_alter().

*/

function bartik_amp_library_info_alter(&$libraries, $extension) {

  // This library persists even if listed in libraries-override.

  // This code will pull it out for good.

  if ($extension == 'core' && isset($libraries['html5shiv'])) {

    unset($libraries['html5shiv']);

  }

 

}

 

/**

* Implements hook_preprocess_html().

*

* Reset toolbar classes and add sidebar toggle button to the header.

*/

function bartik_amp_preprocess_html(&$variables) {

foreach ($variables['page']['#attached']['html_head'] as $key => $value) {

    // Remove any other scripts that are being attached to the page.

    if ($value[0]['#tag'] == 'script' && (!isset($value[0]['#attributes']['type']) || $value[0]['#attributes']['type'] != 'application/ld+json')) {

      unset($variables['page']['#attached']['html_head'][$key]);

    }

  }

 

// AMP Toolbar wrapped the toolbar in amp-sidebar, which is always

  // vertical. Change the page classes to reflect that.

  // @see toolbar.html.twig.

  if (!empty($variables['page_top']['toolbar'])) {

    if (!empty($variables['attributes']) && $variables['attributes'] instanceof Attribute) {

      $variables['attributes']->removeClass('toolbar-horizontal');

      $variables['attributes']->addClass('toolbar-vertical');

    }

    else {

      $variables['attributes'] = new Attribute($variables['attributes']);

      $variables['attributes']->addClass(['toolbar-tray-open', 'toolbar-vertical', 'toolbar-fixed', 'toolbar-loading']);

    }

}

}

 

Hope it helps!

Life and Business in Georgia

Life and Business in Georgia - or another awesome weekend has been recorded - Together with a business partner from Canada exploring construction sites in Tbilisi, building relationships while hiking around Turtle lake, and sipping hot wine with Guliani.

Fun with Santa and his socks. Thumbs up and enjoy!

How To Buy (or not) Real Estate in Tbilisi - Samgori EcoCity December 2022 Update

At the start of December 2022, Uday, a business partner from Canada arrived in Tbilisi, and we went together to the Meti office in Saburtalo to meet with the developers and sign the documents on-site (we already had them electronically). After the meeting with the developers, we went to the actual construction site in Samgori.

I have been eyeing real estate in Georgia since I originally come up with my idea - buying black frame projects in Batumi, I wanted to raise the capital using a token (and I'm still open) until at the start of September Uday contacted me and showed his keen interest investing in more classical FIAT way.

After some longer e-mail correspondence, one Zoom call, and several meetings with contractors both in Batumi and Tbilisi, we narrowed down to one apartment at the Samgori EcoCity project by Meti.

Timeline

Uday checked at the Marriott Courtyard hotel next to Liberty Square and followed my suggestion for opening a bank account at the Bank of Georgia, it turned out his international phone number is not working for receiving sms from the Bank of Georgia, and I kindly provided one of my numbers. That's what business partners are for, right?

It was Friday morning and after a cup of cappuccino at the hotel's lobby, we took a taxi (or a cab, as Uday likes to call it) and headed to Meti Office in Saburtalo. 

We arrived a little bit early and spent some time talking about projects in Tbilisi, Batumi, Antalya (Turkey), and more.

At one point I realized that we are actually not buying an apartment in an already built house, but we might be buying a new, built from the ground. The wording "shall be built" in a contract confused me

We decided to check this first with the developer. 

Turned out to be true. I was falsely believing that we are buying in an almost finished 12-storey apartment building. Or I was left to believe during the previous times when meeting with Meti. Instead, we are buying a 47m2 apartment in a planned 15-storey building that is still going to be built from the ground. 

I truly understood this is my fault, for not checking out everything properly. I said to Uday - look, you have come here to Tbilisi from the other part of the globe just because you believed my word and I have let you down. 

The business partner felt disappointed for about 5 minutes, but then we started to work out our options, decided to visit the actual construction site, talk to contractors and then decide.

So we took a cab again and traveled from Saburtalo to Samgori.

Here we met with a contractor from Meti who let us into the actual planned construction site and we had a chance to see, the foundation laid about 1 year ago.

Samgori EcoCity construction site in Tbilisi December 2022

Also, we learned, the developer is having some issues with the construction permit (general redesign plan?), and they are waiting for the issue to be cleared in about a month (January 2023) - it didn't sound encouraging, but also didn't sound false and didn't give us a reason to mistrust this project, just to be more cautious.

Navtlugi farmers market next to the Samgori EcoCity

We negotiated our 20% downpayment down to 0% (that increased our price from $580 to $600 per sqm), but at least we spread the risk by not going all in today to find out that we are in trouble just a month later. Smaller monthly payments now will give us more confidence in the future, if some delays happen  (the chance that there will be delays still is high)

Construction site started in a neighboring land plot

When talking with Uday, we concluded that this deal is still very good, despite seems will take us at least 36 months to exit with a profit (the developer insists on 20).

Anyhow, more confidence will be gained on the day the developer will get a construction permit or when we will see the construction works started. 

In case, the construction project starts soon, we except it to actually be finished by the end of 2025, but we also are concidering early exit strategies, as we believe that the buying price will increase from $600 to $700 per sqm on the day when the actuall construction works will start. As we have secured agreement with a payment of $600 (and developer also agreed to lower it to $580 on the day when we will make increased 20% downpayment.)

i'm confident in the project, the developers seems reputable, but I also acknoweledge, delays might happen and 36 month term might turn out quite optimistic.

Interested to learn more or invest with us? See: Ecocity Samgori, Tbilisi


Samgori EcoCity updates: This followed my October 2022 scouting article. For the next chapter, see my January 2023 EcoCity Samgori update.

Interested in property or life in Georgia? If you have a serious question, partnership idea or something specific you would like to discuss, you can contact me here.

Pullman Tbilisi Axis Tower Gym and Pool

Pullman Tbilisi Axis Towers Wellness Center is located in Vake (37M Ilia Chavchavadze Avenue) on the 6th floor at Axis Tower. It has a 25 meters heated indoor pool with a retractable roof, sauna, steam room, gym (more like a fitness), spa treatment rooms, and a lounge.

We booked an unlimited membership here for one month in November 2022 (paying GEL 600 each, kids go free) with unlimited access to the gym pool and sauna facilities.

Kids (pre-schoolers) going free was the selling moment for us - as I believe this is a great family deal, spend about GEL 1,200/mo but gain access to a gym, and swimming pool - a good and healthy way to spend the winter months in Tbilisi.

My favorite gym for years has been and still is the Champions Academy on Aghmanashebeli avenue. In fact, during the month of November, I visited both gyms, sometimes both on the same day. lol

Treadmills at Axis Tower

Kind of brand new and equipped with the latest soft, built by Techn0Gym but still I'm not very enthusiastic about the Technogym brand. Don't get me wrong. They do the job, just are not very sturdy. If comparing gym equipment at Champions Academy - it feels much better over there. It seems I just prefer the Freemotion brand over Technogym. Though the software-equipped treadmills are fun and the soft can actually help with setting up your training cycle. 

Author of this blog captured in Action

During the past few months, I have dropped about 17kg -  intermittent fasting, plus daily gym going and medium workouts with dumbells and more.

Dumbells at Axis Tower

The gym is decent - it has most of the important equipment to work out both with the upper and lower body.

Most of the machines seem are again from Technogym. As this is not my favorite brand, I'm not 100% happy with them, but again, they do their work - and the rest is up to you. Some can train in a meadow by just throwing rocks. So to be on the objective side - the gym is very decent. 

Heated indoor swimming pool at Axis Tower

I believe the selling element for this wellness center is the swimming pool, two hot pools, saunas, and great cappuccino from the restaurant.

We also got happy by hiring a 7-time Georgian champion in butterfly swimming to teach our 4-year-old daughter swimming here (12 lessons GEL 550 as in 2022)

I guess this place is rocking also in Summer, with outdoor sun decks that could be an awesome place to chill in Tbilisi. 

How To Create Custom Token on Solana Blockchain without Coding - Part 1

It has been already several years since I have been originally thinking of launching a custom crypto token.

For most of the time, I was thinking about issuing smart contracts on the Ethereum network. Probably a high price for minting on the ETH network and the additional learning curve kept me back most of the time and I never actually proceeded with my idea.

Back in spring 2022 again I returned to the idea of issuing custom tokens, for Batumi Real estate crypto investment, I even launched a pre-sale token, but at the end attracted anchor investor who was more interested to make this deal in a more classical, FIAT way, now we are coinvesting in Tbilisi with cash, see: Ecocity Samgori, Tbilisi

Im still looking to put this real estate on blochchanin, but besides real estate I also trade options with crypto on deribit platform and I thought that I could issue a "crypto fund" token, for attracting investment for covered call trades.

With past several month beeing involved in Solana trading, I learnt more and more about this coin and network, and decided to try Solana network over Etherum (lower price and seems easier to implement). So I come up with idea to create a crypto fund for selling covered calls and decided to launch this crypto fund on Solana network. See: Raising $10,000 capital for issuing Covered Call Crypto Fund (Solana blockchain)

In the remaining article I'll share some notes how I launched (minted) custom token on DexLab (Solana Blockchain) in less than 5 minutes without any coding:

withour further ado:

Things you will need: Phantom wallet, some SOL deposited on it, custom icon for your token

Head to https://www.dexlab.space/mintinglab/spl-token, where all magic is done

Choose: Token Minting

Minting Custom token on DexLab

Basically thats it's  - from this single page you can make your next multibillion token

Name: Give your token a name. TerraMatris

Symbol: Chose something catchy. TerraM

Description: 

Upload to Symol image URL or IPFS: 

Press: Upload Metadata (IPFS)

make sure your wallet is connected and you have enough SOL to cover the network fees

Once done, move on to the Create Token

here you can fine tune some settings, like how many coins there will be in supply, how many decimals e.t.c.

Complete. You will be asked to pay some additonal network fee, but you are done. Congrats you just issued a custom token on Solana network. 

TerraM coin

Now, next steps are to list this coin on decentrelized exchange and start trading. But that's already another topic, with whom I will come soon.

Hope it helps!