Category: Uncategorized

  • Javascript date formatting

    Convert an existing valid date format to another We will do this without any external library. To convert January 25 2023 to 2023-01-25, use this: Note that regular getMonth() returns month from 0 for January, hence add 1 to it. But this is not needed for d.toLocaleString.

  • How to add webview in swiftui xcode app

    You can add a web view in your SwiftUI app by using the WebView component provided by the WebKit framework. Here are the steps to add a web view in your SwiftUI app: 1. Import the WebKit framework at the top of your file: 2. Create a SwiftUI view that contains a WebView instance: 3. […]

  • Next.js CheatSheet

    .htaccess file for static Next.js build You can generate the static html version of nextjs through: This will generate the static version of your site in /out folder. You can copy that out folder to the root of your webhosting, e.g. in public_html/ Then add this .htaccess file to the same folder if required: Loop […]

  • NextJS import images dynamically from directory

    We can import images directly from a folder in nextjs and use their original path and filename by using the code below. Routinely, we import the image that we want to show on the page using import statement like this: However, we can avoid doing that and use dynamic method like this: Example with Splide […]

  • driver_pnp_watchdog error on Boot Camp Windows

    While trying to install windows on a macbook pro 2019, using boot camp assistant, I received the error: driver_pnp_watchdog Initially the Setup is starting screen took a long while, then the installation screen was not responsive and i wasn’t able to click or use mouse keys. Then it ended up in a blue screen of […]

  • JavaScript Spread operator – arrays vs objects

    JavaScript Spread operator – arrays vs objects

    JavaScript spread operator is the simple three dot notation which spreads the array or object for us. For example: However, there are some differences in how we use them with regards to arrays and objects. JavaScript spread operator for arrays JavaScript spread operator for arrays is simple and straight forward. Check these examples: Here we […]

  • [Solved] Macbook pro HDMI external monitor heat issue

    This post will finally help you fix the macbook pro intel high temperature issue when connecting an external monitor, even when fans are running at full spin and loud. I had been struggling with fixing the issue on my macbook pro 16 inch (2019 intel based) too, and finally got it resolved. How to solve […]

  • jQuery Scroll page to element

    We can use jquery to scroll our page to any specific element. Some key things to keep in mind before that are: The target element should be present on the page It’s better to include the target element as an id There should be only one id for that element on the page Note that […]

  • pip install Flask_mysqldb not working on mac

    This post will help you fix the issue of pip or pip3 install not working for flask_mysqldb. The error might include that: Solution: Step 1: is to install brew if you don’t have it on your mac. Install it from brew official website: or by running this command (copied from their website): You might […]

  • Python Flask CheatSheet

    Flask is a python framework used to run webserver. Flask HelloWorld Note, the capital F in flask after import keyword and also in app =. Flask live reload on code changes To reload the flask server whenever there are changes to the files, use debug=True in, like this: Flask Render Template We can separate […]

Hire Me!