React native stylesheets hover

27 Mar, 2025
In React Native, there's no built-in hover state like in web-based React. However if you are working with React Native Web, you want to use div instead of View and apply styles via className from an...

Create patch from uncommitted changes

17 Mar, 2025
Git
There are two options when generating a patch from uncommitted changes: git diff and git diff --cached. git diff captures unstaged changes, modifications in the working directory that have not been...
Linux

Compare 2 files with diff

13 Mar, 2025
This snippet demonstrates how to generate a unified diff (.patch file) between two files using diff -u and apply the patch using patch -p1. This method is useful for tracking changes and updating...
Drupal

Retrieving the Request Path in Drupal 7 Correctly

12 Mar, 2025
In Drupal 7, request_path() is often used to get the request URI. However, this function relies on $_GET['q'], which may not always reflect the actual request URI shown in the browser, especially...

How to Generate Source Maps for Web Builds in Expo

5 Mar, 2025
This snippet shows how to generate source maps for a static web export in Expo. This is useful if you want to self-host your web build or integrate with tools like Sentry for error tracking. There...

Render components based on the platform in React Native

1 Mar, 2025
In Expo, you can conditionally render components based on the platform (web or mobile) using the Platform module from react-native. Here's an example of how to load a component only for web and...

Expo web: Generate .htaccess During Export

1 Mar, 2025
Automatically generate the .htaccess file for you each time you export your Expo web app.

Securely store a JWT token for web and mobile

1 Mar, 2025
This solution is designed specifically for Expo because it uses expo-secure-store. Using SecureStore on mobile and cookies for better security on web.
Drupal

Using ajax_command_invoke in Drupal 7

28 Feb, 2025
ajax_command_invoke is a powerful function in Drupal 7 that allows you to invoke JavaScript methods on DOM elements after an AJAX callback. These code examples will show you through setting up a...
Drupal 9

Drupal Core Development Setup with DDEV

7 Feb, 2025
In this setup, we are creating a Drupal core development environment using DDEV, a Docker-based local development tool. We start by configuring DDEV in a project directory, then clone the official...