How to login to your Drupal site using Drush
abhai 12 April 2023As a Drupal developer, if your local and dev setup is done correctly and you have access to the dev servers, there is no need to ask your Tech Lead or Architect or client for credentials to login to the dev/test site. In fact, I can't remember the last time I had to ask someone for credentials to login to a dev site.What's the difference between git merge and git rebase?
abhai 12 April 2023The main difference between the two is that git merge creates a new commit to merge the changes from one branch into another, while git rebase moves the entire branch to a new base commit and reapplies the changes from the original branch on top of the new base commit.Tags
How to add blt to ddev Drupal projects
abhai 2 December 2022BLT is Acquia's CLI tool that helps build and deploy Drupal applications easily. You can use it for non-Acquia hosted projects as well and it makes Drupal DevOps so much easier.
For those using VMs and docker for local setup, it can be hard to get the blt command to work without ssh-ing into the VM or docker container.
Tags
How to warm your CDN cache using warmer?
abhai 15 November 2022Download the binary:
wget https://github.com/codingsasi/warmer/releases/download/0.0.1-rc4/warmer
Usage:
# warmer http(s)://someurl.com/sitemap.xml interval ./warmer https://abh.ai/sitemap.xml 5 # interval of 5 seconds ./warmer https://abh.ai/sitemap.xml 1 # interval of 1 second
Set as a cronjob every day:
crontab -e
Then add the following to it.
Schedule linkedin posts using buffer for better reach and engagement
abhai 15 November 2022I've been struggling to post on social media and one of the major problems for that was I write my own content, and publish my own content. But weirdly, I never thought of something to automate this and schedule it so that I don't have to keep posting it one by one.
This has saved me a lot of time and my GA has already reported a spike in daily website traffic.
Tags
Can we use Webpack and TypeScript in our Drupal themes?
abhai 14 November 2022It is possible to use webpack in Drupal theme. Follow the repo in this article for transpiling SCSS to CSS and transpiling typescript to JavaScript in your Drupal theme using webpack.How to add a "Manual Approval" step to GitHub Actions
abhai 14 November 2022Manual Approvals in GitHub Actions are available in the form of Reviewing Deployments for GitHub Pro, GitHub Team, or GitHub Enterprise. But what if you want to set it up on a private repo that is not using a paid plan? Here's what to do:
Free dummy/placeholder images of any size
abhai 25 June 2022Go to abh.ai/place and input the width and height of the image you want to generate. Select from 5 categories of images. These images are free to use, just credit me when you use them.
Click on generate to generate the image. You'll get a link of an image you can use.How to download an external library in your composer project?
abhai 23 April 2022Sometimes you might need to download and use a library that is not provided by any composer providers in your Drupal, Symfony or other composer managed PHP project. But this doesn't mean you'll have to resort to downloading and committing the whole folder.How to easily setup git hooks for your Drupal project?
abhai 23 April 2022Git hooks facilitates some scripts or commands that you can run before or after any git commands. For example, you can set to lint, validate your code using phpcs before every commit or push.Tags
Some essential Drush commands
abhai 23 April 2022How to use AWS s3 as your Drupal File System?
abhai 20 March 2022Firstly, install the s3fs Drupal module and enable it on your local. Then go on to your AWS account, if you already don't have one create one and adding your billing details. It is important to add your billing details because otherwise you won't be able to use anything. even if it is in the free tier.