Checking the role of the user

import { GetUserDetails } from "../../services/userDetails.js";

export ... {
  const [userRole, setUserRole] = useState(null);
  
   {userRole == "ADMIN" ? (
     ...
    ) : (
      ...
    )}
    
    
    -----------------------------
    
    
    { name: 'Updates',  route: 'Updates', adminOnly: true },
    { name: 'Users',    route: 'Users',   adminOnly: true },
    
    const visibleTabs = allTabs.filter(tab => {
        if (tab.adminOnly) return isLoggedIn && userDetails?.role === 'ADMIN

The data of the user

import { useUser } from '../../context/UserContext.jsx';

export ... {
  const { user: userDetails } = useUser();
  
   {userDetails?.username || mockUser.name}
   {userDetails?.email || mockUser.email}
   {userDetails?.role || mockUser.role}
   
   
   
   
}

Is The User Logged In

import { useAuth } from '../../context/AuthContext.jsx';

export ... {
  

  const { user } = useAuth();
  const isLoggedIn = !!user;
  
   {!isLoggedIn && (
      ...
    )}

    {isLoggedIn && (
      ...                     
    )}
  
}

Context(User)

import React, { createContext, useContext, useState, useEffect } from 'react'; // importing React hooks and Context API utilities needed to manage user state
import AsyncStorage from '@react-native-async-storage/async-storage'; // importing AsyncStorage to retrieve the authentication token stored on device
import { GetUserDetails } from '../app/services/userDetails.js'; // importing the service function that fetches user profile data from the backend API
import { useAuth } from './AuthContext.js

Context (UI)

import React, { createContext, useContext, useState } from 'react';

const UIContext = createContext(null);

// Manages which auth modal (login / signup) is currently open.
// Keeping this separate from AuthContext means the nav components
// can open modals without prop-drilling through every screen.
export function UIProvider({ children }) {
    const [modal, setModal] = useState(null); // 'login' | 'signup' | null

    const openLogin  = () => setModal('login');
    const openSignu

Context (Auth)

import React, { createContext, useContext, useState, useEffect } from 'react';
import AsyncStorage from '@react-native-async-storage/async-storage';

const AuthContext = createContext(null);

export function AuthProvider({ children }) {
    const [authUser, setAuthUser] = useState(null);
    const [isLoading, setIsLoading] = useState(true);

    // On mount, restore session from storage
    useEffect(() => {
        const checkToken = async () => {
            try {
                

Fetch "PATCH" with Image

export async function EditUpdate(id, title, article, image) { // Patch updates
    try {

        const token = await AsyncStorage.getItem("access"); // get the token for authentication
        if (!token) {
            throw new Error("Authentication failed!");
        }

        const formData = new FormData(); // creating an empty const for formData

        if (title) formData.append("title", title); // append th title
        if (article) formData.append("article", article); // a

Nawf prompt

Create an ultra-detailed ornamental typography poster featuring the phrase “TRILLA THAN THA REST” in giant custom hand-lettered calligraphy. The typography is the absolute main subject, filling most of the composition. Use dramatic thick-and-thin strokes, engraved shading, sharp serifs, layered swashes, ribbon banners, tightly interlocked decorative forms, and bold dimensional outlines. The lettering should feel handcrafted, premium, aggressive, and highly readable, with a vintage Chicano lowrid

1594. Maximum Non Negative Product in a Matrix

You are given a m x n matrix grid. Initially, you are located at the top-left corner (0, 0), and in each step, you can only move right or down in the matrix. Among all possible paths starting from the top-left corner (0, 0) and ending in the bottom-right corner (m - 1, n - 1), find the path with the maximum non-negative product. The product of a path is the product of all integers in the grid cells visited along the path. Return the maximum non-negative product modulo 109 + 7. If the maximum product is negative, return -1. Notice that the modulo is performed after getting the maximum product.
/**
 * @param {number[][]} grid
 * @return {number}
 */
var maxProductPath = function(grid) {
    const MOD = 1_000_000_007;
    const m = grid.length;
    const n = grid[0].length;

    // Create DP tables for max and min products
    const maxDP = Array.from({ length: m }, () => Array(n).fill(0));
    const minDP = Array.from({ length: m }, () => Array(n).fill(0));

    // -- 1. Initialize the starting cell --
    maxDP[0][0] = grid[0][0];
    minDP[0][0] = grid[0][0];

    // -- 2. Fill the f

NFC_setup

#include <Adafruit_PN532.h>
#include <Wire.h>

#define I2C_SDA 8
#define I2C_SCL 9

Adafruit_PN532 nfc(-1, -1);

uint8_t allowedUID[] = {0x01, 0x23, 0x45, 0x67}; // secret code
// for phonew uid is changeing
uint8_t allowedLength = 4;

bool checkUID(uint8_t *uid, uint8_t uidLength)
{
  if (uidLength != allowedLength)
    return false;
  for (uint8_t i = 0; i < uidLength; i++)
  {
    if (uid[i] != allowedUID[i])
      return false;
  }
  return true;
}

void setup()
{
 

VL53L0X_setup

#include <Arduino.h>
#include <Wire.h>
#include "Adafruit_VL53L0X.h"

Adafruit_VL53L0X lox = Adafruit_VL53L0X(); // +-1cm 

void setup()
{
  Serial.begin(115200);
  delay(1000);

  Wire.begin(8, 9);
  delay(500);

  Serial.println("Adafruit VL53L0X test.");

  if (!lox.begin(0x29, false, &Wire)) // 0x29
  {
    Serial.println(F("Failed to boot VL53L0X"));
    while (1);
  }

  Serial.println(F("VL53L0X ready!"));
  lox.startRangeContinuous();
}

void loop()
{
  if (lo

jsonなどをcsvに変換してダウンロードさせる

<a id="download-csv" download="data.csv">CSVダウンロード</a>

Fix Girouette

In terminal Ubuntu

`docker update --restart=on-failure:10 girouette`

In docker-compose.yml

```
  girouette-reload:
    image: docker:cli
    depends_on:
      app:
        condition: service_started
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: docker restart girouette
    restart: "no"
    networks:
      - webgateway
```

C1 U18

H
interior design
dairy?
scrarces
tight budget
a world leader
uncludgered
comunity bounds
belonging

I
take off
come up with
black canvas
do up
property ladder
hustle and bustle

J
pebbly beach
chicky - naughty, mischi
seagel
garden court

ESP32-CAM_testSetup

#include <Arduino.h>
#include "esp_camera.h"

#define PWDN_GPIO_NUM  -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM  15
#define SIOD_GPIO_NUM  4
#define SIOC_GPIO_NUM  5

#define Y9_GPIO_NUM    16
#define Y8_GPIO_NUM    17
#define Y7_GPIO_NUM    18
#define Y6_GPIO_NUM    12
#define Y5_GPIO_NUM    10
#define Y4_GPIO_NUM    8
#define Y3_GPIO_NUM    9
#define Y2_GPIO_NUM    11
#define VSYNC_GPIO_NUM 6
#define HREF_GPIO_NUM  7
#define PCLK_GPIO_NUM  13


bool initCamera()

1886. Determine Whether Matrix Can Be Obtained By Rotation

Given two n x n binary matrices mat and target, return true if it is possible to make mat equal to target by rotating mat in 90-degree increments, or false otherwise.
/**
 * @param {number[][]} mat
 * @param {number[][]} target
 * @return {boolean}
 */
var findRotation = function(mat, target) {
    const n = mat.length;

    // Helper: rotate matrix 90° clockwise
    const rotate = (m) => {
        const res = Array.from({ length: n }, () => Array(n).fill(0));
        for (let i = 0; i < n; i++) {
            for (let j = 0; j < n; j++) {
                res[j][n - i - 1] = m[i][j];
            }
        }
        return res;
    };

    // Try all 4 rotation