Rename a file if same already exists

While uploading a file you may want to check if a file already exists in target directory then create a new file instead of replacing and rename new file with an incremental no. Example some_dir/some_file.png already exists, and you try to upload a file with name some_file.png again, so it should be uploaded as some_dir/some_file1.png […]

Integrating stripe using stripe.js and stripe-php library

Stripe is getting popular as a payment processor because of its simplicity and PCI compliance. To meet with PCI standards your website shouldn’t send or store any credit card information to any where other than stripe, so to send credit card information directly to stripe we use stripejs. How it works Stripe.js collects credit card […]

fatal: refusing to merge unrelated histories

When you already have some thing in your git repo for example you created a git repo on github with readme file and then tried to push your local code first time to that github repo. So github repo already has a commit, it will force you to first pull it to your local code […]

Stripe error Amount must be at least 50 cents

Uncaught StripeErrorInvalidRequest: Amount must be at least 50 cents Stripe expects amounts in cents/pence, so if you pass amount as amount = 10 This will be considered as 10 pence instead of 10 USD. So when Stripe gets pence lower than 50 it generates that error. How to send USD instead of pence You need […]

Adding local code to github

Github is a great source of sharing your code with other developers. It allows you to create free repositories online. Follow the steps below to create a repo on github and upload your code to that repo to make it public Go to GitHub and create account there or login. Create a new repo by hitting the […]