jymden.com


  • Add Firebase Crashlytics to Flutter

    Add Firebase Crashlytics to Flutter

    (This article is a work in progress. Keeping it here for now as reference) This was written when Flutter was at version 3.27. But will probably work fine with little adjustments in later versions. I’m focusing on Android, but many steps apply for iOS too. I will update the article in the future to cover…

    read more…

  • Time String Helper

    Time String Helper

    Formatting Time in Flutter/Dart: A Simple Helper Class When working on Flutter projects, you might need to format durations into readable time strings. This could be for timers, media players, or activity trackers. To make this task a bit easier, here’s a lightweight helper class, TimeStringHelper, that handles common formatting needs. What TimeStringHelper Does Converts…

    read more…

  • Use search terms in eloquent queries for Laravel

    Use search terms in eloquent queries for Laravel

    I needed to make an Eloquent query that could take search terms. The search terms are optional – no search term and the whole dataset is returned. In our particular data model the Users have one or many Associations. So the search term should check for user name, phone, email and association name. In the…

    read more…

  • Impersonate users with Sanctum in Laravel

    Impersonate users with Sanctum in Laravel

    I needed to write a somewhat clean solution to let an admin impersonate other users. Which basically means that one user can appear as another user – without having to get access that users credentials to log in. The most obvious use case for this would be when an admin needs access to a user’s…

    read more…

  • Round integer to 10,100, 1000 etc.

    Round integer to 10,100, 1000 etc.

    If you need to shave off the last few digits of a big int, you can use this simple solution. Came in handy for me when working with milliseconds in timers. Basically you cast the integer to a double and divide it by the number of 0’s you want at the end. Then round, ceil…

    read more…

  • Calculate price excluding VAT

    Calculate price excluding VAT

    Sometimes you need to calculate the price of a product excluding VAT, and the only details you have is the amount including vat and the vat percent. This might be a bit tricky in some applications when there are mixed VAT percentages. For example, you paid 1000 space credits and in that sum there is…

    read more…

  • Convert short color hex to pair

    Convert short color hex to pair

    If you have a three digit hex for a color. For example #FFF and want to convert it to a 6 digit number here’s a simple way:

    read more…

  • Validate date in format YYYY-MM-DD

    Validate date in format YYYY-MM-DD

    A simple JS function to validate that a date string in the format YYYY-MM-DD is a valid date. Will validate that the day is correct for the given month, including leap years

    read more…

  • Validate Swedish personnummer and organisationsnummer

    Validate Swedish personnummer and organisationsnummer

    JavaScript functions for validating Swedish personal identity numbers (personnummer), and organisation numbers (organisationsnummer). The functions for personal identity number will also validate co-ordination number (samordningsnummer).

    read more…

  • Laravel with SSL through Cloudflare on Heroku.

    Laravel with SSL through Cloudflare on Heroku.

    I deployed a Laravel app on Heroku, using Cloudflare for SSL. As a quick note, here’s how I did it. NOTE: if you’re using Laravel 5.4 or higher it’s forceScheme instead of forceSchema Also, you need to set your Laravel environment variable APP_ENV to production (or at least something else than local). Do this in…

    read more…

  • Use include method in IE

    Use include method in IE

    Here’s a hack for using the includes method also in the horrible Internet Explorer.

    read more…

  • Serve Laravel to the web

    Serve Laravel to the web

    This will make your Laravel instance available on the web. Make sure your router have port 80 forwarded to your machine. Also make sure no other server applications is blocking the port.

    read more…

algorithm (11) android (12) app (8) array (4) C# (6) coding (5) computer science (3) css (4) csv (2) dart (2) database (6) date (2) eloquent (3) form (5) graphics (2) gui (5) html (14) html5 (2) https (2) images (2) java (9) javascript (12) jquery (2) laravel (13) log (2) logic (4) math (4) mvc (2) mysql (9) orientation (2) php (24) queries (1) query (1) replace (2) screen (4) server (2) snippet (4) sorting (2) sql (3) string (2) time (2) tutorial (4) ui (3) validation (2) visual studio (3)