Posts

Celebrating Birthdays: A Tradition of Joy and Reflection

Birthdays are more than just a date on the calendar; they are milestones marking another year of life, growth, and experiences. Celebrated worldwide in countless ways, birthdays hold deep personal and cultural significance. Whether a grand party or a quiet reflection, this day offers an opportunity to embrace joy, appreciate loved ones, and look forward to the future. The Importance of Birthdays Birthdays symbolize the journey of life. They remind us of the passage of time and the progress we’ve made. They offer a chance to pause and reflect on personal achievements, challenges overcome, and lessons learned. While aging might sometimes feel daunting, birthdays are a celebration of resilience, memories, and the promise of tomorrow. For many, birthdays are also a time for gratitude. It’s an occasion to cherish the relationships that enrich our lives—friends, family, and colleagues who stand by us through thick and thin. The warm wishes and gestures of love on this day serve as a reminder...

Things you should consider before starting a blog

Image
It’s been a year, I am writing blog posts. I thought it is an easy task. However believe me it requires lots of efforts and dedication. Over the journey of one year I have made some mistakes and I want to share my thoughts on this. I am the only one maintaining my blog and I am a working professional. Post per week goal When I started writing I had a goal of writing post per week. However this requires strong dedication. As days passed by, I found it difficult to achieve this goal and almost failed. Another dimension is, you can’t just sit, start writing and publish. You should create quality and original content and creating quality content takes time. Hosting choice If you are thinking of starting a blog and thinking of hosting on your own then I would strongly recommend considering other options like free blog hosting on wordpress.com or google’s blogspot/blogger for at least initial period. Over this period you will gain some experiences about bl...

Building a TypeScript API SDK using Webpack that uses Authorization

Developing an SDK (Software Development Kit) simplifies interactions with APIs for client developers. In this blog, we’ll create a TypeScript SDK for a User API , using Webpack for bundling and extracting types into a separate file. We'll also include support for an Authorization header for secure API requests. This SDK will cover the following operations: Create a User ( POST /users ) Update a User ( PUT /users ) Get All Users ( GET /users ) Get a Single User ( GET /users/{id} ) Delete a User ( DELETE /users/{id} ) Partially Update a User ( PATCH /users/{id} ) We will go through below steps Project Setup Defining the User Types Creating the API SDK Configuring Webpack Building the SDK and Extracting Types Testing the SDK Conclusion 1. Proj...

6 steps to create local copy of your live WordPress site

I know there are bunch of other posts on how to create local copy of your live WordPress site, however, they are too much descriptive. Here I will show you step by step approach rather than descriptive one. 1. Export your live database into an sql file. 2. Download/Copy your live WordPress site folder to your local machine. 3. Move your downloaded WordPress site files inside local server’s web root. 4. Open exported sql file using notepad or any other editor of your choice and replace “http://www.yoursite.com” with “http://localhost/wordpress” and Save that file. (CAUTION: This file could be very large so replacing might take time. Command for replacing file content on *nix based system.) 5. Import database from that sql file into your local mysql database. 6. Open wp-config.php file which you can find inside your copied WordPress folder. In that file replace DB_NAME with your local WordPress database which you imported in above step. DB_USER with database user name. D...

Partially rendering Handlerbars from Backbone view

Image
While working on a project I had this situation where I wanted to render a view partially after some ajax is done. In this post I will explain how to render HandlerBar views partially. For the purpose of demonstrate I will simulate delay using setTimeout() function instead of an ajax request. So for an example lets consider following setup 1. Template <script id="PersonTemplate" type="text/x-handlebars-template"> <div> {{firstName}} {{lastName}} <div> <div id="divPartial"> <a href="{{website}}">{{website}}</a> </div> </script> 2. Backbone Model var PersonModel = Backbone.Model.extend({ defaults: { firstName: 'Bharat', lastName: 'Patil', website: '' } }); 3. Backbone view using Handlerbars view var TestView = Backbone.View.extend({ //assign model view instance model: objPerson, //get the...

Step by step Cordova calabash-ios automation

Step by step guide about how to integrate calabash-ios with Cordova in an automated way without opening Apple Xcode. Note: First try steps given on https://github.com/calabash/calabash-ios . If those steps aren’t working for you then try following steps. For me only manual steps given on above link worked. Also this script doesn’t create separate target same as “calabsh-ios setup” command. I also presume that you have already setup your cordova project and nodejs . sudo gem install calabash-cucumber If you get any error then try using following command sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install calabash-cucumber reference Go inside your Cordova project directory npm install xcode npm install fs-extra npm install underscore Download script “cordova-calabash-ios.js” from here and paste it inside your cordova project at www level (not inside www). (Note: This is very primitive script you can modify it according to your n...

DataSync PhoneGap/Web applications using LocalStorage

Recently I have developed a PhoneGap application in which I wanted to synchronize data with server. In this post we will see a simple method to send data from PhoneGap application / Web application using LocalStorage as a queue. Conditions were like below: Store data in queue locally in LocalStorage Sync data with server if online when application comes online it should start syncing the data again if any upon successful sync remove from queue else try again synching one item at a time I have developed this solution using Backbone and Backbone LocalStorage plugin. Lets start understanding the solution. 1. Backbone Model var QueueModel = Backbone.Model.extend({ defaults:{ 'url': null, 'method': null //http method like GET, PUT, POST etc. } }); This model is nothing but representation of ajax settings that can be found here . 2. Backbone Collection used as a Queue which is using Backbone.LocalStorage plugin. You should use singleton p...