Hi there! 👋 Thank you for visiting! Whatever you are looking for, I hope you will find it.
If you want to reach out, you can contact me anywhere you'd like. You can find my social media channels right above the main navigation.
If you want to say hi via email,
An in-depth look at RxJS’s distinctUntilChanged Operator
In this post, we’ll have an in-depth look at RxJS’s
distinctUntilChanged operator, it’s signature and what it does, it’s parameters
keySelector, and typical use cases for each of them and both of them.
Creating a Delayed Input Directive in Angular
Imagine in your app there’s a search input that triggers an http request on each keystroke as a user types in their query. As your userbase grows, search operations quickly become expensive due to the increased traffic to your server.
Creating a Lazy Loaded Image Cropping Modal Component with Ionic 5 and ngx-image-cropper
Demo and source code
Configure Proxy Redirect with Scully - The Static Site Generator for Angular apps
Passing Additional Parameters To An Angular Service
If you want to pass additional parameters to an Angular service, what you are looking for is @Inject decorator. It helps you pass your parameters to the service through Angular’s dependency injection mechanism.
Adding Custom Content To Akveo’s @nebular/theme 4.5.0 Sidebar Component
So I’ve been working with Akveo’s Nebular UI Kit for a while now and it’s been a real issue adding custom content to
Angular: Allow Users Retry Failed Requests With A Twitter-Like Try Again Button
While using the Twitter web app, I noticed it displays a
Try Again button for failed requests in different sections of the user interface. This allows the user retry each failed request without affecting the rest of the application, quite neat.
4 Angular NgForOf Exported Values I Was Not Aware Of - first, last, even, and odd
Angular’s NgForOf provides exported values that can be aliased to local variables. Until today, I’ve only been aware of the
index exported value, turns out there’s a couple more.
How To Extract and Display Laravel Validation Errors in Angular
While working on Xamcademy, I’ve had the need to extract and display form validation errors returned by the Xamcademy API which is powered by Laravel. I wrote a utility function a while back which I forgot about, and remembered while trying to write something similar today.
Safely Ignore Platform Requirements using Composer v2
I’ve learned the hard way that blindly using Composer’s
--ignore-platform-reqs can lead to issues like the downloading of package versions that are not compatible with your PHP version. I am on PHP 7.4 but packages using PHP 8 features were being downloaded, leading to this error:
Install Laravel Horizon in Laravel 7
To install Laravel Horizon in Laravel 7, run below command in your terminal:
Query Records Created Between Two Dates in Laravel
I have been trying to query records created between the start of the current month and the current date and time. If the current time is
2021-06-10 16:11:04, the query should return records created between
2021-05-01 and this time.
Laravel HTTP Client Retry Without Throwing an Exception
I used Laravel’s HTTP Client
retry() feature for the first time yesterday and was surprised it throws an exception on failure of all retries instead of returning the failure
Livewire: Confirm form submission before proceeding
Spent the last couple of hours trying to get this working. Here’s what finally worked:
Two Ways to get a Form Input’s Value in Cypress
Given the below form, how do we get any individual input’s value inside a Cypress test?
Testing File Download Links with Cypress
Say my homepage contains the below snippet, which allows a user to download vcard files. I’d like to make sure the file download links are valid and point to existing files.
Native Platform Check Without Importing Capacitor
I wanted to be able to check the platform my app is running on without importing Capacitor, thereby improving my web build’s bundle size. Capacitor already exposes the following methods for querying the current platform:
Create a Seconds-Only PHP DateInterval
I wanted to test an interval was being respected which required me to add a seconds-based interval value to a Carbon date object.
Laravel: Only retrieve a specific property from the first matching model
Using Laravel Eloquent, I wanted to only get a specific property - the
id - from the first matching model of my query.
Laravel: Dynamic Array Input Form Field Example
In my app, I have a promotion’s table which has a field called
phone_restrictions, which is an array of phone numbers a promotion is restricted to.
Laravel: Localized Carbon Date String Example
I wanted to return a translated date string from a Carbon date object and after some research, used the below solution which worked for me. It is quite brief, do leave a comment if you’ve got a question.
Storing timespans in a MySQL database
I’ve been working on coupon/promotion codes functionality and one requirement is only allowing the re-use of a coupon code after a period of time has passed. It could be a couple of hours, a couple of days, or a month at most.
Laravel: Test validation message key is defined in all translation files, en, fr, etc
Below is the validation language line we want to test, It’s found in
resources/lang/fr/validation.php my app supports just two languages at this time, English and French.
Laravel: Test replacement value is passed to validation string
Below is the validation language line we want to test, I added it to the array in
Netlify build command for an Ionic Angular app
Build command input field, enter
ng build --prod, and in the
Publish directory input field, enter
Determine Mapbox map tiles have loaded by listening for the “idle” event
idle event is fired after the last frame rendered before the map enters an “idle” state. When this event is fired, we are sure of the following things:
- All currently requested tiles have loaded.
- No camera transitions are in progress.
- All fade/transition animations have completed.
Test an Ionic Build, or an Ionic PWA locally
If you don’t have
http-server installed, go ahead and install it globally.
Angular Service Worker: Prefetch all assets on first run
I’ve been working on the PWA version of a mobile app and it was brought to my attention that when using the PWA offline, some icons that were placed in the
/src/assets directory fail to load.
Rendering ion-item’s Content “Predictably”