Home avatar

Building and implementing end-to-end solutions to solve real-world problems

Switch Virtual Desktop With Mouse Gesture on Windows 11

If you want to switch virtual desktops with mouse gestures on Windows 11, you can use a third-party software called StrokeIt. StrokeIt is a mouse gesture recognition program that allows you to perform various actions by drawing gestures with your mouse.

Here’s how you can set up StrokeIt to switch virtual desktops on Windows 11:

  1. Download and Install StrokeIt:

    You can download StrokeIt from its official website here. Follow the installation instructions to set it up on your computer.

Mi Band Record Incorrect in Bed Data on Sleep Variable of Health IOS

If you’re experiencing issues with your Mi Band recording incorrect “In Bed” data on the Sleep variable in the Health app on iOS, there’s a simple solution you can try. This problem can often be resolved by adjusting your iOS device’s timezone settings. Here’s a step-by-step guide on how to do it:

Step 1: Open the Settings App on Your iOS Device

Unlock your iOS device and locate the “Settings” app on your home screen. It looks like a gear icon and is typically found on the first page of your apps.

How to Login to a Shared Folder With Your Windows Account on Windows 11

If you want to access a shared folder on Windows 11 using your Windows account password, follow these steps:

  1. Open Settings:

    • Click on the Start button (Windows logo) in the taskbar.
    • Click on the Settings (gear-shaped) icon to open the Windows Settings app.
  2. Navigate to Accounts:

    • In the Windows Settings app, click on the Accounts category.
  3. Change Sign-in Options:

    • Under the Accounts section, click on Sign-in options in the left sidebar.
  4. Disable Windows Hello (Recommended):

How to See Currently Logged in Users in Windows 10 - 11

If you want to see the currently logged-in users on a Windows 10 or Windows 11 system, you can use the Command Prompt and the query user command. Here’s a step-by-step guide on how to do it:

  1. Open Command Prompt: Press Win + X and select “Windows Terminal” or “Command Prompt” from the menu. You can also simply search for “Command Prompt” in the Windows search bar and open it.

Building a Go Application With Docker: Optimized Dockerfile

In this article, we will walk through the creation of an optimized Dockerfile for building and running a Go application. This Dockerfile will focus on building only the binary of the Go application, resulting in a smaller and more efficient Docker image.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Dockerfile for Building a Go Application

```Dockerfile
# Stage 1: Build the Go Binary
FROM golang:1.17 as builder

# Set the working directory inside the container
WORKDIR /app

# Copy the Go application source code into the container
COPY . .

# Set environment variables
ENV CGO_ENABLED=0

# Fetch dependencies and build the Go binary
RUN go get -d -v ./...
RUN go build -o /tmp/api-server .

# Stage 2: Create a minimal runtime image
FROM scratch

# Copy the binary from the builder stage into the minimal image
COPY --from=builder /tmp/api-server /usr/bin/api-server

# Define the command to run when the container starts
CMD ["api-server", "start"]

In this Dockerfile, we use a multi-stage build to optimize the final Docker image. Here’s a breakdown of what each section does:

React: Scroll to Top Instantly After Router Transition

In a React application, it’s common to want to scroll to the top of the page instantly after a router transition, such as when navigating to a new page or route. This provides a smooth user experience and ensures that the user starts reading the new content from the top of the page. To achieve this, you can use JavaScript’s window.scrollTo() method with the behavior: 'instant' option. In this article, we’ll explore how to implement this behavior in a React application.