Boto3 Single Session across the project

How to create a single boto3 session and use it across a python project? Here is the solution: Create session.py Paste the following code: import boto3 import os class Session: session = None def __init__(self): self.get_session() @classmethod def get_session(cls): if cls.session is None: cls.session = cls.start_session() return cls.session @staticmethod def start_session(): if ‘AWS_ROLE_ACCESS_KEY’ in os.environ:continue reading

Fetch Single Github File in Python

As I mentioned in the earlier post, I was recently working on a private project. We had to fetch a single GitHub file from a private Github repository without hardcoding the token or setting it as an environment variable. I could not easily find a ready solution. So prepared one. I am posting the solutioncontinue reading

Drupal Save Profile Image Programmatically

When we use the Profile 2 module and need to save the profile image field (existing), we can use profile2 functions and achieve the task. Note down the Field needs to be updated. Load the profile. Add Image field to the loaded profile object Save the profile. function save_image_profile2($profile_id, $image_id){ // Load the profile objectcontinue reading

Wpionic-material Demo

Demo coming soon. Update I have not got time to maintain this project. If you are interested to continue the development of WP Ionic Material, please feel free to contact me.

WordPress Ionic Material Design App Instructions

Wpionic-material is a multi-platform mobile application built using ionic framework. It uses wordpress api to get and post data from/to your wordpress site. Ionic uses Cordova to build application archives for Android and Ios Platforms. WP Ionic material design Installation: Install wp-api plugin to your wordpress site. Download wordpress ionic material app source code. Change var server = ‘http://demo.wp-api.org/’;continue reading