The blog is mostly about recent roadblocks I encountered while working or something that eat up lot of time solving, I share it here for my personal future references, apart from that recent small snipts of codes, or whatever I feel like posting when I have nothing to do.
I like aws elastic beanstalk to deploy high availability and scalable php applications without worrying about the underlying server operations. Recently I was a testing EFS for zend application, here is the sample directory structure of Zend Framework 3 app:
As I wanted to share the `data` directory between EC2 instances, I thought to try EFS to share `data` folder between instances and so i created a EFS outside of beanstalk and used .ebextensions to mount the by providing the ID in the config script.
After the first deployment, everything went smooth. But after 2nd and 3rd deployed, I noticed an error in application and to my surprise the data directory was empty, even though it was showing as mountpoint.
I thought may be the EFS was not mounted properly or EFS is having downtime, after checking everything, I concluded that EFS is indeed empty, and now the question is how?
After doing few sample deployments I found out that the Elastic beanstalk during deployment deletes everything in the whole /var/app/current directory and copies the new application code, which indeed deletes the data folder, which is a mountpoint of EFS.
I think elastic beanstalk should use CodeDeploy to deploy the app which would have given error during deployment if a non versioned file is found, rather then deleting all files and copying. Otherwise I am not sure how EFS can be used in elasticbeanstalk unless you are mounting the directory outside of /var/app/current, because `eb deploy` will delete the all content of data directory everytime.
Thankfully i was working on dev environment and only lost of about few Mbs of application's data files.
Recently a potential employer posted a Job on odesk, wanted a script to clear the Google Spreadsheet content daily using Google Spreadsheet PHP API. I told him about Google Apps Script, and how we can use it to achieve this as using PHP API wasn't a requirement.
Using Google Apps Script we can clear the content of the Google Spreadsheet daily or on specific time of the day.
1) Open the spreadsheet and click Tools > Script Editor.
2) Copy and Paste the following Google Apps Script
Save and give relevant name to the script.
3) Set Trigger to execute the 'clear' function at midnight
Triggers > Current Scripts Trigger > Add New
This script also adds a new menu to toolbar, Scripts > Clear
We can set different type of triggers, for more read script guide.
P.S. Tad, Enjoy!
Recently got my first Video Testimonial from one of my employer Mr. Gavin Allinson, a Sports Nutritionist, as I don't have a Video CV of myself, this reference stand top of my testimonials, So decided to post it on the blog.
Since I started freelancing after my college, I have worked on about 100 projects across oDesk.com and vWorker.com. Its been nice learning curve to chat & work with clients across the globe.
Short review: Epic Awesomeness!
I HAD GREAT WORKING EXPERIENCE WITH ANKIT, 3 OR 4 TIMES BETTER THAN SO CALLED PROGRAMMERS U SOMETIMES FIND ON ODESK.
I have worked with a lot of providers, and I must say Ankit is by far
the best one to work with. We have been able to complete jobs together
in half the time as others quote the job for, and he understands 100%
what is needed on his end for the job. I am sad to see him leave, but
will look forward to working with him again.
Wish I could give him a higher rating as he's like a 20 out of 10. Great communication, lightning fast turnaround and a joy to work with. I think I might start to consider him my IT web guy! If you are thinking about using him, stop thinking and go for it as he is the best out there.
Very very excellent friendly coder. Easy to talk to and very knowledgeable about alot. A+ and also very affordable then most of the other prices other coders offer. Will definitely use services again in the future.
I certify that Mr. Ankit sharma of India - Jamnagar has done a job of Web-site design and its implementation for my organization.
When you add any media files link in wordpress page/post content (mp3, asf, wmv, avi etc), it creates a automatic meta key(Custom Fields) in the post called "enclosed" with value as actual path of that media file.
Furthermore, the Website feed(RSS) embeds the enclosed media as a link "Download Now" or "Filname" linked to the actual media file.
It creates problem when your website have regular posts with media links for eg. podcast, background music etc. hence the feed subscriber get a download link in their feed subscription.
Just paste the following lines of codes within your themes functions.php file, and then, say goodby to automatic enclosures.
What it does is, override the function do_enclose() in /wp-includes/functions.php(line 1164 - Worpress v3.01) and return blank string hence no enclosure code is executed.
Created a sample gadget while learning about Google gadgets . This gadgets displays random quotes on every page refresh, quotes are embedded in gadget XML file.
Once again I encountered a Magento query in my freelancing career and here is the solution.
Recently a client also wanted to sell "Gift Certificates" as a product with no shipping rate since its a virtual gift card.
I search around a lot but didn't got solution any solution, also found that so many people asking the same question on Magento forum with no answer except only solution was to purchase an extension ranging from price 80$-360$ to handle shipping rates. Hence I suggested my client to purchase the extension.
But that wasn't convincing solution to me because if an extension can do it then there must be a solution. After few days, I found that new Magento version has a feature called "Shopping Cart Rules".
It provide multiple ways to handle shipping rate, in short, you can create any sort of rule of your own to handle shipping rates.
Let’s run through a scenario to get a better understanding of how to configure Magento for free shipping on specific category/products.
1) In this scenario we will be offering free shipping to Products in Category "Gift Certificates" having category Id : 10
2) Set up through Promotions -> Shopping Cart Price Rules -> Actions so that the free shipping will automatically apply if the conditions are met.
3) Since our Shopping Cart Rule is not limited to any product attributes, we can either choose “For matching items only” or “For shipment with matching items” in the Shopping Cart Price Rule Actions as Free Shipping option.
4) Now here, if we select “For matching items only”, if there are multiple items in the shopping cart, the free shipping will only apply for the product within the "Gift Certificates" category and other shipment charges on non-"Gift Certificates" items will be calculated separately.
This is just of many techniques to offer free shipping to your customers.
P.S. I would suggest to purchase Extension if you have more complex shipping requirements.
Recently a client approached me to create weather widget for Wordpress, which will display weather information using Google Weather API.
The API call was simple but the main thing was the design of the widget and similar to the one the client saw on some other site.
The main thing about this particular design is that, it displays icons according to the weather condition i.e cloudy, sunny, clear , rainy etc
Here is the screen shot of the widget:
Download php code here :
Google Weather API Code
I was looking for solution to display all products in 1 page in Magento version 1.4 then I came across an article showing all special products. I made the changes in products filter to display all products.
All the files are attached here:
1) Add Special.php on the following location :
2) Create Folder Special and Add Toolbar.php on the following location :
3) After you are done with this you have to now move to
4) Now you can go to Admin Panel->CMS->Pages create a New Page and in
the content paste this line:
Now you can save this page and assign this page’s link anywhere on the
Today received a funny email from my past employer & friend, Jasmit Vala with the subject title:
Very rare photos of SSD (Sleeping Software Developer), Dont miss it!!!
So curiously when I opened it, I couldn't stop myself laughing, as it had my own pics sleeping while at work. These are pics of my Training Period from Jan-2009 to July-2009, myself getting caught red handed by my boss.
Here is what I think:
It was really difficult for me to work after LUNCH, I don't know how people do it, Yeah its true, I have been caught sleeping many times during working hours BUT I used to stay in office late till 10pm -2am and always completed my work. I cannot work constantly for 8 hrs, not even 10 mins, that doesnt mean I suffer from ADD(Attention Deficit Disorder) Thatswhy I think freelancing is good, I can work from bed, take a nap in-between, suits my kind of style.
Overall, it was good company to do my training, I learned a lot from My bosses, Jasmit and Himanashu, Both are real talented Programmers & great Individuals to work with.
Apart from that, the most enjoyable time was watching my bosses arguing with each other.
Original Post Date : April 21 2010 5:59 PM
Finally, RenaACoder team decides to change the looks of website, not only that But they have come with the new Company name 'vWorker'.
Why the change? We're changing to reflect the diversity of the many talented workers we have on the site. Back when I founded the company in 2001 we concentrated just on technology and programming, and the name Rent a Coder fit us. But today in 2010, the site is not just coders, but also graphic artists, writers, translators, marketers, personal assistants and numerous other types of workers. Our new name will reflect that and reminds employers that they can find all kinds of talent here. Read More
Checkout the new looks HERE
I personally liked the old name "RentACoder", as I am being a coder, But I agree with company's propective and wish them for their continued success in future.
Original Post Date : April 16 2010 1:02 PM