Python: Array/List Rotation – Right

On September 19, 2018, in Coding, Python, by Dipin Krishna

Python program to rotate an array towards its right Inplace Method # Rotate Array def roateRight(arr, size, rotate_count): array_length = len(arr) if array_length <= 0: return arr   if size > array_length: size = array_length   # Figure out effective roation count # eg: size = 10 and rotation_count = 15 # effective roation_count is […]

Tagged with:  

Python: Array/List Rotation – Left

On September 18, 2018, in Python, by Dipin Krishna

Python program to rotate an array towards its left Inplace Method # Rotate Array def roateLeft(arr, size, rotate_count): array_length = len(arr) if array_length <= 0: return arr   if size > array_length: size = array_length   # Figure out effective roation count # eg: size = 10 and rotation_count = 15 # effective roation_count is […]

Tagged with:  

PHP Error:0607A082:digital envelope routines:EVP_CI PHER_CTX_set_key_length:invalid key length

On June 18, 2018, in Coding, PHP, by Dipin Krishna

If you are trying to use and older version of PHP to connect MYSQL over SSL, there is a good chance that you encounter the following errors: error:0607A082:digital envelope routines:EVP_CI PHER_CTX_set_key_length: error:0906D06C:PEM routines:PEM_read_bio:no start line This is a bug in PHP, OpenSSL. This bug has been fixed in PHP versions > 7.1. In case you […]

Tagged with:  

HubSpot Cookie Consent – Control the use of non-HubSpot cookies on your website

On June 4, 2018, in Coding, HubL, HubSpot, Javascript, by Dipin Krishna

The HubSpot Cookie Consent banner sets a cookie name ‘__hs_opt_out’ when you accept/decline the cookie consent. You can make use of the status of the consent to remove/allow other cookies on your website, eg: google analytics. We can get the status of the consent by adding a callback function to the ‘addPrivacyConsentListener’ event. //Add a […]

Tagged with:  

HubSpot – Show the Privacy Cookie Consent Banner above the Body instead of an Overlay

On May 24, 2018, in Coding, HubL, HubSpot, by Dipin Krishna

When you enable the Cookie Policy in HubSpot you only have two options, either to show it as a top banner or as a bottom banner. The top banner is going to be a fixed banner, making it an overlay on the content at the top. Use the following jQuery code to push the body […]

Tagged with:  

HubSpot – Search Functionality for Blogs

On May 11, 2018, in Coding, HubL, by Dipin Krishna

This piece of HubL code can be used to search for a keyword in a single blog or multiple blogs. You can use the below HubL code in a separate template for search page or in the blog-listing template. In case you are going to use in the blog-listing template, you will have to tweak […]

Tagged with:  

Search