Snippets Collections
// Does not send any data, but just tests the payload 
Boolean testPayloadFormat = false;

// Configuration
String namedCredentialName    = 'TDX_DC_ORG';
String ingestionApiName       = 'Smart_Bill';
String ingestionApiObjectName = 'Smart_Bill';

// Create a payload
String streamingIngestionPayload = JSON.serializePretty(new Map<String,List<Map<String,Object>>>{
    'data' => new List<Map<String,Object>>{
        new Map<String,Object>{
            'Amount'       => 'id',
            'Id'           => utl.Rst.Guid(),
            'UUID'         => utl.Rst.Guid(),
            'CreatedDate'  => String.valueOf(Datetime.now()),
            'Name'         => JSON.serialize([SELECT Id FROM User WHERE Id = :UserInfo.getUserId()]),
            'Invoice_Date' => String.valueOf(Date.today())
        }
    }
});
 
// Create the request endpoint based on the NC and Named Credential details
HttpRequest request = new HttpRequest();
request.setEndPoint(String.format(
    'callout:{0}/api/v1/ingest/sources/{1}/{2}{3}',
    new String[]{
        namedCredentialName,
        ingestionApiName,
        ingestionApiObjectName,
        (testPayloadFormat) ? '/actions/test' : ''
    }
));
request.setHeader('Content-Type','application/json');
request.setMethod('POST');
request.setBody(streamingIngestionPayload);
 
// Execute
HttpResponse res = new HTTP().send(request);
System.debug(res.getStatusCode());
System.debug(res.getBody());
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
int main(){

int x = 3;
double y = 3.589;
float f = 5.6;
char c = 'A';
_Bool b = true;//stdbool.h
char name[] = "HT Prince";

printf("x = %d\ny = %.2lf\nf = %f\nc = %c\nb = %d\nname = %s\n",x,y,f,c,b,name);
printf("Hello your name is: %s",name);

return 0;


}
#include<stdio.h>
#include<stdlib.h>
#define PI 3.14

int main(){

const int x=5;
double y=3.0;

y=PI;

printf("x=%d\n",x);
printf("y=%lf\n",y);

printf("the address of y in memory is:%p",&y);


return 0;
}
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<style type='text/css'>
#random-posts img{display:block;margin:0;margin-right:10px;padding:0;width:72px;height:72px;border:1px solid #f5f5f5;overflow:hidden;float:left}
#random-posts img:hover{opacity:0.6;}
ul#random-posts{list-style:none;margin:0;padding:5px 0 0;overflow:hidden;border-top:none;}
#random-posts a{color:#000;transition:all .3s;display:block}
#random-posts li:hover a,#random-posts a:hover{color:#0088ff;}
.random-summary{font-size:13px;color:999}
#random-posts li{margin:0;padding: 0px 0px 10px 0px;min-height:65px;position:relative;border-bottom:1px solid #f5f5f5;transition:all .3s;}
</style>
<ul id='random-posts'>
<script type='text/javaScript'>
var randomposts_number = 5;
var randomposts_chars = 0;
var randomposts_details = 'no';
var randomposts_comments = 'Comments';
var randomposts_commentsd = 'Comments Disabled';
var randomposts_current = [];
var total_randomposts = 0;
var randomposts_current = new Array(randomposts_number);
function randomposts(json) {
    total_randomposts = json.feed.openSearch$totalResults.$t
}
document.write('<script type=\"text/javascript\" src=\"/feeds/posts/default?alt=json-in-script&max-results=0&callback=randomposts\"><\/script>');
function getvalue() {
    for (var i = 0; i < randomposts_number; i++) {
        var found = false;
        var rndValue = get_random();
        for (var j = 0; j < randomposts_current.length; j++) {
            if (randomposts_current[j] == rndValue) {
                found = true;
                break
            }
        };
        if (found) {
            i--
        } else {
            randomposts_current[i] = rndValue
        }
    }
};
function get_random() {
    var ranNum = 1 + Math.round(Math.random() * (total_randomposts - 1));
    return ranNum
};
</script>
<script type='text/javaScript'>
function random_posts(json) {
    for (var i = 0; i < randomposts_number; i++) {
        var entry = json.feed.entry[i];
        var randompoststitle = entry.title.$t;
        if ('content' in entry) {
            var randompostsnippet = entry.content.$t
        } else {
            if ('summary' in entry) {
                var randompostsnippet = entry.summary.$t
            } else {
                var randompostsnippet = "";
            }
        };
        for (var j = 0; j < entry.link.length; j++) {
            if ('thr$total' in entry) {
                var randomposts_commentsnum = entry.thr$total.$t + ' ' + randomposts_comments
            } else {
                randomposts_commentsnum = randomposts_commentsd
            }; if (entry.link[j].rel == 'alternate') {
                var randompostsurl = entry.link[j].href;
                var randomposts_date = entry.published.$t;
                if ('media$thumbnail' in entry) {
                    var randompoststhumb = entry.media$thumbnail.url
                } else {
                    randompoststhumb = "https://2.bp.blogspot.com/-F1lTdmXTr0Y/VmpR_HBcVyI/AAAAAAAAGa8/a2_2T-p3AKM/s1600/bungfrangki_no_image_100.png"
                }
            }
        };
        document.write('<li>');
        document.write('<a href="' + randompostsurl + '" rel="nofollow"><img alt="' + randompoststitle + '" src="' + randompoststhumb + '" width="' + 72 + '" height="' + 72 + '"/></a>');
        document.write('<div><a href="' + randompostsurl + '" rel="nofollow">' + randompoststitle + '</a></div>');
        if (randomposts_details == 'yes') {
            document.write('<span><div  class="random-info">' + randomposts_date.substring(8, 10) + '.' + randomposts_date.substring(5, 7) + '.' + randomposts_date.substring(0, 4) + ' - ' + randomposts_commentsnum) + '</div></span>'
        };
        document.write('<br/><div class="random-summary">' + randomposts_snippet + '</div><div style="clear:both"></div></li>')
    }
};
getvalue();
for (var i = 0; i < randomposts_number; i++) {
    document.write('<script type=\"text/javascript\" src=\"https://www.kurazone.net/feeds/posts/default?alt=json-in-script&start-index=' + randomposts_current[i] + '&max-results=1&callback=random_posts\"><\/script>')
};
</script>
</ul>
<div class='clear'/>
</div>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

int main()
{
  int i1;
  printf("i1=%d\n",i1);

  i1 = 5;
  printf("i1=%d\n",i1);

  i1 = -3;
  printf("i1=%d\n",i1);

  i1 = 3.5;
  printf("i1=%d\n",i1);

  double d1 = 3.5;
  printf("d1=%lf\n",d1);

  d1=0;
  printf("d1=%lf\n",d1);

  float f1 = 3.7;
  printf("f1=%f\n",f1);

  char c = 'A';
  printf("%c\n",c);

  c=65;
  printf("%c\n",c);

  int code ='A';
  printf("%d\n\n",code);

  _Bool b=0;
  printf("b=%d\n",b);

  b=1;
  printf("b=%d\n",b);

  b=2;
  printf("b=%d\n",b);

  b=-1;
  printf("b=%d\n",b);

  b=false;
  printf("using keywords b=%d\n",b);
  b=true;
  printf("using keywords b=%d\n\n",b);

  char name[]="Tharaka Weerasena";
  printf("%s\n",name);

  int x = sizeof (int);
  printf("number of bytes of an int:%d bytes\n",x);
  printf("number of bits:4*8=32 bits\n");
  printf("we can store 2^32 in an integer"); //429496796


    system("pause");
    return 0;
}
#include <stdio.h>

//Sum
float sum(float x, float y);
float difference(float x, float y);
float product(float x, float y);
float quotient(float x, float y);


int main()
{
    float n1, n2;
    float S, D, P, Q;
    char symbol;
    
    printf("Enter two numbers:\n");
    scanf("%f", &n1);
    scanf("  %f", &n2);
    
    printf("[+]Sum [-]Difference [*]Product [/]Quotient [x]Exit\n");
    
    printf("Enter Choice:");
    scanf("%s", &symbol);
    switch(symbol)
    {
    case'+':S=sum(n1, n2);printf("Sum:%.2f", S);
    break;
    case'-':D=difference(n1, n2);printf("Difference:%.2f", D);
    break;
    case'*':P=product(n1, n2);printf("Product:%.2f", P);
    break;
    case'/':Q=quotient(n1, n2);printf("Quotient:%.2f", Q);
    break;
    case'x':printf("Exit!");
    break;
    }

}

float sum(float x, float y)
{
return (x+y);
}
float difference(float x, float y)
{
return (x-y);
}
float product(float x, float y)
{
return (x*y);
}
float quotient(float x, float y)
{
return (x/y);
}
#include <stdio.h>

float sum( float n1, float n2);
int main()
{
    float m, n, total;
    printf("Enter first number:");
    scanf("%f", &m);
    printf("Enter second number:");
    scanf("%f", &n);
    total=sum(m ,n);
    
printf("The sum of the two numbers is %.2f", total);
    
    
}
float sum(float n1, float n2)
{
return (n1+n2);
}
    
    
#Nonprod
curl -k -H "Host: ds-colpilot-nonprod.sb.se.com" "http://172.24.44.8/relevancy?application=ResourceAdvisor&utterance=Hello"

#PreProd
curl -k -H "Host: ds-colpilot-preprod.sb.se.com" "http://172.24.52.8/relevancy?application=ResourceAdvisor&utterance=Hello"

#Prod
curl -k -H "Host: ds-copilot-prod.sb.se.com" "http://172.24.52.8/relevancy?application=ResourceAdvisor&utterance=Hello"
import { useEffect, useState } from "react";
import { useSupabaseClient } from "@supabase/auth-helpers-react";
import { HeadingLink, MinimalPage, PageHeading, Spinner } from "ui";
import type { Database } from "../../../types";
import dayjs from "dayjs";

const ShiftTable = () => {
  const [usersOnShift, setUsersOnShift] = useState<
    Array<{ user: string; shift_start: string | null }>
  >([]);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState("");
  const [offlineUserCount, setOfflineUserCount] = useState(0);
  const supabaseClient = useSupabaseClient<Database>();

  useEffect(() => {
    const fetchUsers = async () => {
      setLoading(true);
      setError("");

      try {
        // Fetch users on shift and their emails
        const { data: usersOnShiftData, error: onShiftError } =
          await supabaseClient
            .from("UserLastWorkedOn")
            .select("shift_start, user, users_view (email)")
            .not("shift_start", "is", null);

        // Fetch count of users not on shift (offline users)
        const { count: offlineCount, error: offShiftError } =
          await supabaseClient
            .from("UserLastWorkedOn")
            .select("user", { count: "exact" })
            .is("shift_start", null);

        if (onShiftError || offShiftError) {
          setError(
            onShiftError?.message ||
              offShiftError?.message ||
              "Failed to fetch user shift data"
          );
          return;
        }

        // Sort the users on shift by their email address
        const sortedUsersOnShift = (usersOnShiftData ?? [])
          .map((user) => ({
            shift_start: user.shift_start,
            user: Array.isArray(user.users_view)
              ? user.users_view[0].email
              : user.users_view?.email ?? user.user,
          }))
          .sort((a, b) => a.user.localeCompare(b.user));

        setUsersOnShift(sortedUsersOnShift);
        setOfflineUserCount(offlineCount ?? 0);
      } catch (err) {
        setError("Failed to fetch user data");
        console.error(err);
      } finally {
        setLoading(false);
      }
    };

    fetchUsers();
  }, [supabaseClient]);

  return (
    <MinimalPage
      pageTitle="Shift Table | Email Interface"
      pageDescription="Spot Ship Email Interface | Shift Table"
      commandPrompt
    >
      <div className="flex w-full flex-col items-center justify-center">
        <HeadingLink icon="back" text="Home" href="/secure/home" />
        <PageHeading text="Spot Ship Shift Table" />
        <div className="mb-4 text-sm text-gray-400">
          {usersOnShift.length} user(s) currently on shift. Offline users:{" "}
          {offlineUserCount}.
        </div>
        {loading ? (
          <Spinner />
        ) : error ? (
          <p className="text-red-500">Error: {error}</p>
        ) : usersOnShift.length ? (
          <div className="overflow-hidden overflow-x-auto rounded-3xl border-transparent shadow-lg">
            <table className="table-auto rounded-xl bg-gray-800">
              <thead className="bg-gray-700 text-gray-400">
                <tr>
                  <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
                    User Email
                  </th>
                  <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider">
                    Shift Started
                  </th>
                </tr>
              </thead>
              <tbody className="divide-y divide-gray-700">
                {usersOnShift.map((user, index) => (
                  <tr key={index}>
                    <td className="whitespace-nowrap px-6 py-4 text-sm">
                      {user.user}
                    </td>
                    <td className="whitespace-nowrap px-6 py-4 text-sm">
                      {dayjs(user.shift_start).format("DD-MM-YYYY | HH:mm")}
                    </td>
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
        ) : (
          <p className="text-gray-400">No users are currently on shift</p>
        )}
      </div>
    </MinimalPage>
  );
};

export default ShiftTable;
// Apply force - More up assist depending on y position
var assistPoint = Mathf.InverseLerp(0, _maxY, _rb.position.y);
var assistAmount = Mathf.Lerp(_maxUpAssist, 0, assistPoint);
var forceDir = -transform.forward * _forceAmount + Vector3.up * assistAmount;
if (_rb.position.y > _maxY) forceDir.y = Mathf.Min(0, forceDir.y);
_rb.AddForce(forceDir);

// Determine the additional torque to apply when swapping direction
var angularPoint = Mathf.InverseLerp(0, _maxAngularVelocity, Mathf.Abs(_rb.angularVelocity.z));
var amount = Mathf.Lerp(0, _maxTorqueBonus, angularPoint);
var torque = _torque + amount;

// Apply torque
var dir = Vector3.Dot(_spawnPoint.forward, Vector3.right) < 0 ? Vector3.back : Vector3.forward;
_rb.AddTorque(dir * torque);
Private Sub CreateMyListView()
    ' Create a new ListView control.
    Dim listView1 As New ListView()
    listView1.Bounds = New Rectangle(New Point(10, 10), New Size(300, 200))

    ' Set the view to show details.
    listView1.View = View.Details
    ' Allow the user to edit item text.
    listView1.LabelEdit = True
    ' Allow the user to rearrange columns.
    listView1.AllowColumnReorder = True
    ' Display check boxes.
    listView1.CheckBoxes = True
    ' Select the item and subitems when selection is made.
    listView1.FullRowSelect = True
    ' Display grid lines.
    listView1.GridLines = True
    ' Sort the items in the list in ascending order.
    listView1.Sorting = SortOrder.Ascending

    ' Create three items and three sets of subitems for each item.
    Dim item1 As New ListViewItem("item1", 0)
    ' Place a check mark next to the item.
    item1.Checked = True
    item1.SubItems.Add("1")
    item1.SubItems.Add("2")
    item1.SubItems.Add("3")
    Dim item2 As New ListViewItem("item2", 1)
    item2.SubItems.Add("4")
    item2.SubItems.Add("5")
    item2.SubItems.Add("6")
    Dim item3 As New ListViewItem("item3", 0)
    ' Place a check mark next to the item.
    item3.Checked = True
    item3.SubItems.Add("7")
    item3.SubItems.Add("8")
    item3.SubItems.Add("9")

    ' Create columns for the items and subitems.
    ' Width of -2 indicates auto-size.
    listView1.Columns.Add("Item Column", -2, HorizontalAlignment.Left)
    listView1.Columns.Add("Column 2", -2, HorizontalAlignment.Left)
    listView1.Columns.Add("Column 3", -2, HorizontalAlignment.Left)
    listView1.Columns.Add("Column 4", -2, HorizontalAlignment.Center)

    'Add the items to the ListView.
    listView1.Items.AddRange(New ListViewItem() {item1, item2, item3})

    ' Create two ImageList objects.
    Dim imageListSmall As New ImageList()
    Dim imageListLarge As New ImageList()

    ' Initialize the ImageList objects with bitmaps.
    imageListSmall.Images.Add(Bitmap.FromFile("C:\MySmallImage1.bmp"))
    imageListSmall.Images.Add(Bitmap.FromFile("C:\MySmallImage2.bmp"))
    imageListLarge.Images.Add(Bitmap.FromFile("C:\MyLargeImage1.bmp"))
    imageListLarge.Images.Add(Bitmap.FromFile("C:\MyLargeImage2.bmp"))

    'Assign the ImageList objects to the ListView.
    listView1.LargeImageList = imageListLarge
    listView1.SmallImageList = imageListSmall

    ' Add the ListView to the control collection.
    Me.Controls.Add(listView1)
End Sub
' Declare the Listview object.
Friend WithEvents myListView As System.Windows.Forms.ListView

' Initialize the ListView object with subitems of a different
' style than the default styles for the ListView.
Private Sub InitializeListView()

    ' Set the Location, View and Width properties for the 
    ' ListView object. 
    myListView = New ListView
    With (myListView)
        .Location = New System.Drawing.Point(20, 20)

        ' The View property must be set to Details for the 
        ' subitems to be visible.
        .View = View.Details
        .Width = 250
    End With

    ' Each SubItem object requires a column, so add three columns.
    Me.myListView.Columns.Add("Key", 50, HorizontalAlignment.Left)
    Me.myListView.Columns.Add("A", 100, HorizontalAlignment.Left)
    Me.myListView.Columns.Add("B", 100, HorizontalAlignment.Left)

    ' Add a ListItem object to the ListView.
    Dim entryListItem As ListViewItem = myListView.Items.Add("Items")

    ' Set UseItemStyleForSubItems property to false to change 
    ' look of subitems.
    entryListItem.UseItemStyleForSubItems = False

    ' Add the expense subitem.
    Dim expenseItem As ListViewItem.ListViewSubItem = _
        entryListItem.SubItems.Add("Expense")

    ' Change the expenseItem object's color and font.
    expenseItem.ForeColor = System.Drawing.Color.Red
    expenseItem.Font = New System.Drawing.Font _
        ("Arial", 10, System.Drawing.FontStyle.Italic)

    ' Add a subitem called revenueItem 
    Dim revenueItem As ListViewItem.ListViewSubItem = _
        entryListItem.SubItems.Add("Revenue")

    ' Change the revenueItem object's color and font.
    revenueItem.ForeColor = System.Drawing.Color.Blue
    revenueItem.Font = New System.Drawing.Font _
        ("Times New Roman", 10, System.Drawing.FontStyle.Bold)

    ' Add the ListView to the form.
    Me.Controls.Add(Me.myListView)
End Sub
public class ListView : System.Windows.Forms.Control
background-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
function scrolling(event) {
  let scrollPercent =
    (event.target.scrollTop /
      (scrollableElement.value.scrollHeight -
        scrollableElement.value.clientHeight)) *
    100;
}

window.addEventListener("scroll", function () {
  let st = window.pageYOffset || document.documentElement.scrollTop;
  if (st > window.innerHeight / 2 && st > lastScrollTop) {
    isMenuOpen.value = false;
  } else if (st > window.innerHeight / 2 && st < lastScrollTop) {
    isMenuOpen.value = true;
  }
  lastScrollTop = st <= 0 ? 0 : st;
});

function storeTouchPosition() {
  initialTouchPosition.value = event.touches[0].clientY;
  // initialBottomPosition.value =
  //   draggableElement.value.getBoundingClientRect().bottom;
}
function resizeSublinks() {
  document.body.style.overflow = "hidden";
  let delta = event.touches[0].clientY - initialTouchPosition.value;
  let maxScrollDistance = draggableElement.value.scrollHeight - 130;
  let top = draggableElement.value.getBoundingClientRect().top;

  if (delta > 0) {
    //element is being dragged down
    if (draggableElement.value && top <= 392) {
      draggableElement.value.style.transform = `translateY(${delta}px)`;
    }
  } else if (draggableElement.value && delta * -1 <= maxScrollDistance) {
    draggableElement.value.style.transform = `translateY(${delta}px)`;
  }
}
function stopDragging() {
  document.body.style.overflow = "auto";
  initialTouchPosition.value = null;
}
def generate_file(file_size_mb, file_name):
    file_size = file_size_mb * 1024 * 1024
    with open(file_name, 'wb') as f:
        f.write(b'\b' * file_size)


generate_file(file_size_mb=2, file_name='test.test')
<!-- Google tag (gtag.js) -->

<script async src="https://www.googletagmanager.com/gtag/js?id=G-HTKNHG"></script>
3
<script>
4
  window.dataLayer = window.dataLayer || [];
5
  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());

​
8
  gtag('config', 'G-H34TKNH5G8');

</script>
import mongoose from "mongoose"
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

import {ERC20} from "solmate/tokens/ERC20.sol";

contract MyToken is ERC20 {
    constructor(
        string memory name,
        string memory symbol,
        uint8 decimals,
        uint256 initialSupply
    ) ERC20(name, symbol, decimals) {
        _mint(msg.sender, initialSupply);
    }
}
$ forge create --rpc-url <your_rpc_url> \
    --constructor-args "ForgeUSD" "FUSD" 18 1000000000000000000000 \
    --private-key <your_private_key> \
    --etherscan-api-key <your_etherscan_api_key> \
    --verify \
    src/MyToken.sol:MyToken
# Enable gzip compression for text-based files
http {
   gzip on;
   gzip_types text/plain text/css text/javascript;
}
$(document).ready(function () {
	$('a[data-scroll]').click(function () {
		$('html, body').animate(
			{
				scrollTop: $('.conatct-us').offset().top,
			},
			1000,
		);
	});
});
<!DOCTYPE html>
<html>
<head>
<style>
.button {
  border: none;
  color: white;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;
}

.button1 {background-color: #04AA6D;} /* Green */
.button2 {background-color: #008CBA;} /* Blue */
</style>
</head>
<body>

<button class="button button1">Green</button>
<button class="button button2">Blue</button>

</body>
</html>
<div>
			<h1>GeeksforGeeks</h1>
			<h3>Click on the button to see image</h3>
			<!-- img element without src attribute -->
			<img id="image" src="" />
		</div>
		<button type="button" onclick="show()" id="btnID">
			dixwell
		</button>	
		<script>
			function show() {
				/* Get image and change value 
				of src attribute */
				let image = document.getElementById("image");
				image.src = "495+Dixwell+Avenue.jpeg"
				document.getElementById("btnID")
					.style.display = "none";
			}
		</script>
import { useEffect, useState } from "react";
import { useSupabaseClient } from "@supabase/auth-helpers-react";
import { HeadingLink, MinimalPage, PageHeading, Spinner } from "ui";
import type { Database } from "../../../types";
import dayjs from "dayjs";

const ShiftTable = () => {
  const [usersOnShift, setUsersOnShift] = useState<
    Array<{ user: string; shift_start: string | null }>
  >([]);
  const [loading, setLoading] = useState(true);
  const [error, setError] = useState("");
  const supabaseClient = useSupabaseClient<Database>();

  useEffect(() => {
    const fetchUsersOnShift = async () => {
      setLoading(true);
      try {
        const { data: usersData, error: usersError } = await supabaseClient
          .from("UserLastWorkedOn")
          .select("shift_start, user, users_view (email)")
          .not("shift_start", "is", null);

        if (usersError) {
          setError(usersError.message ?? "Failed to fetch user shift data");
          console.error(usersError);
        }

        const mappedUsers = usersData?.map((user) => {
          const mappedUser: { user: string; shift_start: string | null } = {
            shift_start: user.shift_start,
            user: Array.isArray(user.users_view)
              ? user.users_view[0].email
              : user.users_view?.email ?? user.user,
          };
          return mappedUser;
        });

        setUsersOnShift(mappedUsers ?? []);
      } catch (err) {
        setError("Failed to fetch user shift data");
        console.error(err);
      } finally {
        setLoading(false);
      }
    };

    fetchUsersOnShift();
  }, [supabaseClient]);

  return (
    <MinimalPage
      pageTitle="Shift Table | Email Interface"
      pageDescription="Spot Ship Email Interface | Shift Table"
      commandPrompt
    >
      <div className="w-full">
        <HeadingLink icon="back" text="Home" href="/secure/home" />
      </div>
      <PageHeading text="Spot Ship Shift Table" />
      <div className="flex w-full flex-col">
        {loading ? (
          <Spinner />
        ) : error ? (
          <p className="text-red-500">Error: {error}</p>
        ) : usersOnShift.length ? (
          <table className="mt-4 min-w-full">
            <thead>
              <tr>
                <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
                  User Email
                </th>
                <th className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500">
                  Shift Started
                </th>
              </tr>
            </thead>
            <tbody className="divide-white-200 divide-x ">
              {usersOnShift.map((user, index) => (
                <tr key={index}>
                  <td className=" text-white-500 px-6 py-4 text-sm">
                    {user.user}
                  </td>
                  <td className=" text-white-500 px-6 py-4 text-sm">
                    {dayjs(user.shift_start).format("DD-MM-YYYY | HH:mm")}
                  </td>
                </tr>
              ))}
            </tbody>
          </table>
        ) : (
          <p>No users are currently on shift</p>
        )}
      </div>
    </MinimalPage>
  );
};

export default ShiftTable;
1. git branch
2. git checkout ... (dev oder master)
3. git pull origin dev (master) 
4. git add .(oder separat alle Dateien mit dem Pfad)
5. git commit - m 'dein commit hier'
6. git tag -a TAGNUMMER -m 'tagnummer'
7. git push --tags origin dev (master).
<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <actionCalls>
        <name>Email_Change_Confirmation</name>
        <label>Email Change Confirmation</label>
        <locationX>176</locationX>
        <locationY>335</locationY>
        <actionName>emailSimple</actionName>
        <actionType>emailSimple</actionType>
        <flowTransactionModel>CurrentTransaction</flowTransactionModel>
        <inputParameters>
            <name>emailBody</name>
            <value>
                <elementReference>EmailChangeTemplate</elementReference>
            </value>
        </inputParameters>
        <inputParameters>
            <name>emailAddresses</name>
            <value>
                <elementReference>$Record__Prior.Email</elementReference>
            </value>
        </inputParameters>
        <inputParameters>
            <name>sendRichBody</name>
            <value>
                <booleanValue>true</booleanValue>
            </value>
        </inputParameters>
        <inputParameters>
            <name>senderAddress</name>
            <value>
                <stringValue>noreply_energy@britishgas.co.uk</stringValue>
            </value>
        </inputParameters>
        <inputParameters>
            <name>senderType</name>
            <value>
                <stringValue>OrgWideEmailAddress</stringValue>
            </value>
        </inputParameters>
        <inputParameters>
            <name>emailSubject</name>
            <value>
                <stringValue>Please activate your new email address</stringValue>
            </value>
        </inputParameters>
    </actionCalls>
    <apiVersion>56.0</apiVersion>
    <environments>Default</environments>
    <interviewLabel>Email Change Confirmation {!$Flow.CurrentDateTime}</interviewLabel>
    <label>Email Change Confirmation</label>
    <processMetadataValues>
        <name>BuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processMetadataValues>
        <name>CanvasMode</name>
        <value>
            <stringValue>AUTO_LAYOUT_CANVAS</stringValue>
        </value>
    </processMetadataValues>
    <processMetadataValues>
        <name>OriginBuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processType>AutoLaunchedFlow</processType>
    <start>
        <locationX>50</locationX>
        <locationY>0</locationY>
        <connector>
            <targetReference>Email_Change_Confirmation</targetReference>
        </connector>
        <filterFormula>AND(NOT(ISBLANK({!$Record__Prior.Email})),NOT(ISBLANK({!$Record.Email})),ISCHANGED({!$Record.Email}) )</filterFormula>
        <object>Contact</object>
        <recordTriggerType>Update</recordTriggerType>
        <triggerType>RecordAfterSave</triggerType>
    </start>
    <status>Active</status>
    <textTemplates>
        <name>EmailChangeTemplate</name>
        <isViewedAsPlainText>false</isViewedAsPlainText>
        <text>&lt;p style=&quot;text-align: right;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); font-size: 18px; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif; color: rgb(0, 0, 0);&quot;&gt;You changed your email address&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); font-size: 16px; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif; color: rgb(0, 0, 0);&quot;&gt;Please set up&amp;nbsp;your&amp;nbsp;new password&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); font-size: 18px; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif; color: rgb(0, 0, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Hello {!$Record.FirstName},&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Thanks&amp;nbsp;for updating your email address to {!$Record.Email}.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;When you next&amp;nbsp;log in,&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.britishgas.co.uk/identity&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;https://www.britishgas.co.uk/identity&lt;/a&gt; &lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;you’ll need to&amp;nbsp;set up a new&amp;nbsp;password to get started.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Didn’t request this?&amp;nbsp;&lt;/strong&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;If&amp;nbsp;you didn’t&amp;nbsp;ask us to make&amp;nbsp;this change,&amp;nbsp;please&amp;nbsp;get in touch.&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.britishgas.co.uk/energy/contact-us&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot; style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;https://www.britishgas.co.uk/energy/contact-us&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Just a reminder:&lt;/strong&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Never share your password or security questions with anyone&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Create passwords that are hard to guess and don’t use personal information&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Use different passwords for each of your online accounts&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Your passwords&amp;nbsp;need:&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;To be between 8 and 32 characters&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;To&amp;nbsp;contain at least one upper case&amp;nbsp;letter and&amp;nbsp;one lower case letter&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;To contain at least one number&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Symbols are optional, but are a good way to make a password more secure&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif;&quot;&gt;Th&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif; color: rgb(68, 68, 68);&quot;&gt;anks for being with us for your energy,&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt; font-family: Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif; color: rgb(68, 68, 68);&quot;&gt;Your British Gas Energy Team&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</text>
    </textTemplates>
</Flow>
<ul class="context-menu" data-bind="visible: contextMenu, , style: { left: contextMenuPosition().x + 'px', top: contextMenuPosition().y + 'px' }">
    <li class="context-link" data-bind="click: openInNewTab">
        <span data-bind="attr: { class: 'fa fa-external-link-alt' }"></span>
        <span class="new-tab" data-bind="i18n: 'Open in a new tab'"></span>
    </li>
    <hr>
    <li class="context-link" data-bind="click: copyInClipboard">
        <span data-bind="attr: { class: 'fa fa-copy' }"></span>
        <span class="copy-link" data-bind="i18n: 'Copy in clipboard'"></span>
    </li>
    <li class="context-link" data-bind="click: saveLinkAs">
        <span data-bind="attr: { class: 'fa fa-download' }"></span>
        <span class="save-link" data-bind="i18n: 'Save link as'"></span>
    </li>
    <li class="context-link" data-bind="click: goBack">
        <span data-bind="attr: { class: 'fa fa-arrow-left' }"></span>
        <span class="go-back" data-bind="i18n: 'Back'"></span>
    </li>
    <li class="context-link" data-bind="click: goForward">
        <span data-bind="attr: { class: 'fa fa-arrow-right' }"></span>
        <span class="go-forward" data-bind="i18n: 'Forward'"></span>
    </li>
    <hr>
    <li class="context-link" data-bind="click: refreshPage">
        <span data-bind="attr: { class: 'fa fa-sync' }"></span>
        <span class="refresh-page" data-bind="i18n: 'Refresh'"></span>
    </li>
</ul>
$(document).ready(function ($) {
	$('body .description-form').on(
		'change',
		'.gchoice input[type="radio"]',
		function () {
			if ($(this).is(':checked')) {
				$(this)
					.closest(
						'.gform_page:nth-child(1),.gform_page:nth-child(2),.gform_page:nth-child(3)',
					)
					.find('.gform_next_button')
					.click();
			}
		},
	);
});
//Here is signleton - that means you can create an object of a class outside it

class singleton{
  
  static let shared = singleton()
  init(){} //(Optional to do it or not)
  
  let temp = 5

}

//Usage

viewDidLoad(){
  let num = singleton.shared.temp
  
  //but also you can create object
  let obj = singleton()
  let num = obj.temp
}


//Here is Signleton - that means you cannot create an object of a class outside it

class Singleton{
  
  static let shared = singleton()
  private init(){} //(Optional to do it or not)
  
  let temp = 5

}

//Usage

viewDidLoad(){
  let num = singleton.shared.temp
  
  //but you cannot create object
  //let obj = singleton()
  //let num = obj.temp
}
 // HTML

 <div className='container' data-columns="4">
          <div className="container__block container__block--image1"></div>
          <div className="container__block container__block--image2"></div>
          <div className="container__block container__block--image3"></div>
          <div className="container__block"></div>
      </div>




// CSS

.container{
  width: 1200px;
  height: 600px;
  margin: auto auto;
   background-color: red;
   display: grid;
  //replace the value we want to make dynamic with a var(--something, x) where x is a fallback if --something doesnt exist
  grid-template-columns: repeat(var(--column-count, 4), 1fr); 
  place-content: center;
   align-items: center;
   justify-content: center;
   justify-items: center;

   // use data attribute vales on the html to change the variable --something
   &[data-columns="2"]{
      --column-count: 2;
   }

   &[data-columns="3"]{
    --column-count: 3;
    }

    &[data-columns="4"]{
      --column-count: 4;
    }



   &__block{
    width: 200px;
    height: 200px;
    background-color: rebeccapurple;
    border: 1px solid white;
    background-size: cover;
    background-repeat: no-repeat;
    background-image: var(--selected-url);

        &--image1{
          --selected-url: url('https://source.unsplash.com/user/c_v_r')
        }

        &--image2{
          --selected-url: url('https://www.kimballstock.com/images/car-stock-photos.jpg')
        }

        &--image3{
          --selected-url: url('https://media.gettyimages.com/id/1636857191/photo/topshot-moto-prix-esp-catalunya-practice.jpg?s=2048x2048&w=gi&k=20&c=bt3AqEevYACDxkxf5Rom1MqE4bjHrMG2apxxTkmedJ8=')
        }


   }
 }
https://source.unsplash.com/user/c_v_r
//This pulls out the two functions we need from the db connection file.
const { connectToDatabase, getDb } = require('./db');

// Middleware to connect to the database to see if it is working. If working it assigns the DB connection to a variable.
app.use(async (req, res, next) => {
  await connectToDatabase(); 
  next();
}); 


app.get("/", async (req, res) => {
  //Call our database function to get the variable holding our database connection.
  const db = getDb();
  const collection = db.collection("projects");

  const documents = await collection.find({}).toArray(); 
  res.render("pages/homepage");
});
#To add the URL fro the remote repository
git remote add origin REMOTE-URL

#to verify remote URL
git remote -v

echo "# ml_flow_test" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/carlosribadeneira-se/ml_flow_test.git
git push -u origin main
git merge main

#To add the URL fro the remote repository
git remote add origin REMOTE-URL

#to verify remote URL
git remote -v

PS C:\WINDOWS\system32> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"
//Import Routes 
const indexRoute = require('./routes/index');
const aboutRoute = require('./routes/about');
const pricingRoute = require('./routes/pricing');
const contactRoute = require('./routes/contact');

app.use(indexRoute);
app.use(aboutRoute);
app.use(pricingRoute);
app.use(contactRoute);
const express = require('express');
const aboutController = require('../controller/about');

const router = express.Router();

router.get('/about', aboutController.getAbout);


module.exports = router;
SÁBADO
30/3/2024
// import React from 'react'
import * as React from "react";
import Box from "@mui/material/Box";
import Button from "@mui/material/Button";
import Typography from "@mui/material/Typography";
import Modal from "@mui/material/Modal";
import { useState, useEffect } from "react";
import axios from "axios";


const style = {
  position: "absolute",
  top: "50%",
  left: "50%",
  transform: "translate(-50%, -50%)",
  width: 400,
  bgcolor: "background.paper",
  border: "2px solid #000",
  boxShadow: 24,
  p: 4,
};




function Show() {
const [userData, setUserData] = useState([]);


const runfun = async (id) =>{

console.log(id);


let a = id;

  try {
    const result = await axios.post(http://192.168.0.146:5000/get-single-data/${a});
    setUserData(result.data…Read more
8:45 p. m.
app.post('/get-single-data/:id', (req, res) => {
    // const id = 2225;
    const { id } = req.params;

    console.log(id);

    const query = 'SELECT * FROM app_deperment_section WHERE id = ? ';
    connection.query(query, [id], (err, results) => {
        if (err) {
            console.error(err.message);
            return res.status(500).send(err);
        }
        res.json(results);
        console.log(results)
    });
});
8:46 p. m.
1/4/2024
metoxi-bootstrap-5-admin-dashboard-template-2023-12-06-06-35-20-utc.zip
ZIP•113 MB
6:14 p. m.
VIERNES
in bootstrap if i click then run a function and close this model in react
3:02 p. m.
+918767170191
9:52 p. m.
+918767170191
9:53 p. m.
+918767170191
10:04 p. m.
SÁBADO

10:06 a. m.
TODAY
import React from "react";
import Master from "../Layout/Master";

import { Link } from "react-router-dom";

import { useState, useEffect } from "react";
import axios from "axios";

import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";

import Loding from "../Loding/Loding";

import { server } from "..//../main";

import { confirmAlert } from "react-confirm-alert"; // Import
import "react-confirm-alert/src/react-confirm-alert.css"; // Import css

function Client() {
  // !hook for model update
  const [modalOpen, setModalOpen] = useState(false);
  // !hook for model create Button
  const [create_modalOpen, setCreate_modalOpen] = useState(false);

  const [userData, setUserData] = useState([]);
  // const [selectedUserId, setSelectedUserId] = useState(null);

  // ! loading hook
  const [isLoading, setIsLoading] = useState(true);

  const sessionStorage_user_id = sessionStorage.getItem("user_id");

  const [userField, setUserField] = useState({
    user_name: "",
    user_m_no: "",
    user_w_name: "",
    user_e_nid: "",
    user_a: "",
    user_u_id: "sessionStorage_user_id",
  });

  const changeUserFieldHandler = (e) => {
    setUserField({
      ...userField,
      [e.target.name]: e.target.value,
    });
  };

  // ! --------------------------------------------------
  // Function to open the modal
  const handleCreateButtonOpen = () => {
    console.log("handleCreateButtonOpen");
    setCreate_modalOpen(true);
  };

  // Function to close the modal
  const handleCreateButtonClose = () => {
    setCreate_modalOpen(false);
  };
  // ! --------------------------------------------------
  const onSubmitChange = async (e) => {
    e.preventDefault();
    try {
      const response = await axios.post(
        ${server}/api_v2/clients/cleint_add,
        userField
      );

      var response_data = response.data.msg;
      var response_status = response.data.status;
      if (response_status == "success") {
        fetchData();
        toast.success(response_data);
        // console.log(response_data);
        // toast.success(response_data);
        // Close the modal on success
        setCreate_modalOpen(false);
      } else {
        setCreate_modalOpen(true);
        // toast.success(response_data);
        toast.error(response_data);
        // console.log(response.data);
      }
    } catch (err) {
      console.log("Something Wrong in react ");
      toast.error(response_data);
    }
  };

  const handleDelete = async (id) => {
    // console.log(id)


    try {
      const result = await axios.post(
        "http://192.168.0.109/rpgi/craftzoneapi/api_v2/clients/delete_cleint",
        {
          client_id: id,
          tc_auth_id: sessionStorage_user_id,
        }
        // console.log(result.data.msg);
      );

      if (result.data.msg == "success") {
        toast.success(result.data.msg);
        // fetchData();
      } else {
        toast.error(result.data.msg);
      }

           fetchData();
    } catch (error) {
      // console.log(error);
      toast.error("Internal Server Error");
    }





  };

  // ! -----------------------Get data---------------------------
  const fetchData = async () => {
    //
    try {
      const result = await axios.post(
        "http://192.168.0.109/rpgi/craftzoneapi/api_v2/clients/get_cleints"
      );
      //console.log("FEATCH");

      // console.log(result);

      if (result.data.status === "success") {
        console.log("first")
        setUserData(result.data.clients);
        console.log("FEATCH");



      } else {
        toast.error(result.data.msg);
      }
    } catch (err) {
      console.log("Something went wrong");
    }
  };

  // ! -----------------------Delete data---------------------------

  const deleteData = async (id) => {
    // console.log(id);
    fetchData();
    confirmAlert({
      title: "Confirm to Delete",
      message: "Are you sure to do this.",
      buttons: [
        {
          label: "Yes",
          onClick: () => handleDelete(id),
          
          // alert("Click Yes"),
        },
        {
          label: "No",
          // onClick: () =>

          // alert("Click No"),
        },
      ],
    });
  };

  useEffect(() => {
    fetchData();
  }, []);

  // ! -----------------------show single data data---------------------------

  // const [single_cleint_data, setSingle_cleint_data] = useState({});

  // ! -----------------------Update data---------------------------

  // const [data, setData] = useState([]);
  const [selectedData, setSelectedData] = useState(null);

  const handleCloseModal = () => {
    setModalOpen(false);
  };

  const fetchDataFromServer = async (id) => {
    try {
      const response = await axios.post(
        http://192.168.0.109/rpgi/craftzoneapi/api_v2/clients/get_cleint,
        {
          user_id: id,
        }
      );
      //  console.log(update);
      return response.data;
    } catch (error) {
      toast.error("Internal Server Error");
    }
  };

  const handleEditClick = async (id) => {
    try {
      const newData = await fetchDataFromServer(id);

      if (newData.status == "success") {
        setSelectedData(newData.client[0]);
        setModalOpen(true);
      } else {
        toast.error(newData.msg);
      }
    } catch (error) {
      toast.error("Internal Server Error");
    }
  };

  const handleUpdateData = async () => {
    // Perform actions to update the data
    console.log("Updated data:", selectedData);

    try {
      const users = {
        user_id: selectedData.tc_id,
        user_name: selectedData.tc_name,

        user_m_no: selectedData.tc_m_no,
        user_w_name: selectedData.tc_w_no,
        user_e_nid: selectedData.tc_e_id,
        user_a: selectedData.tc_address,
        user_u_id: sessionStorage_user_id,
      };
      const result = await axios.post(
        "http://192.168.0.109/rpgi/craftzoneapi/api_v2/clients/update_cleint",
        users
      );
      if (result.data.status == "success") {
        // alert("User Data Updated Successfully");
        toast.success(result.data.msg);
        setModalOpen(false);
        fetchData();
      } else {
        toast.error(result.data.msg);
      }
      // Close the modal
    } catch (err) {
      toast.error("Internal Server Error");
    }
  };

  setTimeout(() => {
    // setIsLoading(false);
  }, 2000);

  return (
    <>
      <Master />

      {/* //! update modal */}
      <>
        <div
          className={modal ${modalOpen ? "show" : ""}}
          tabIndex="-1"
          role="dialog"
          style={{ display: modalOpen ? "block" : "none" }}
        >
          <div className="modal-dialog" role="document">
            <div className="modal-content">
              <div className="modal-header">
                <h5 className="modal-title">Edit Data</h5>
                <button
                  type="button"
                  className="close"
                  onClick={handleCloseModal}
                >
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div className="modal-body">
                {selectedData && (
                  <form onSubmit={handleUpdateData}>
                    <div className="form-group">
                      <label htmlFor="name">Name:</label>
                      <input
                        type="text"
                        className="form-control"
                        id="name"
                        name="name"
                        value={selectedData.tc_name}
                        onChange={(e) =>
                          setSelectedData({
                            ...selectedData,
                            tc_name: e.target.value,
                          })
                        }
                      />
                    </div>
                    <div className="form-group">
                      <label htmlFor="name">Mobile Number:</label>
                      <input
                        type="text"
                        className="form-control"
                        id="name"
                        name="name"
                        value={selectedData.tc_m_no}
                        onChange={(e) =>
                          setSelectedData({
                            ...selectedData,
                            tc_m_no: e.target.value,
                          })
                        }
                      />
                    </div>
                    <div className="form-group">
                      <label htmlFor="name">Whatsapp Number:</label>
                      <input
                        type="text"
                        className="form-control"
                        id="name"
                        name="name"
                        value={selectedData.tc_w_no}
                        onChange={(e) =>
                          setSelectedData({
                            ...selectedData,
                            tc_w_no: e.target.value,
                          })
                        }
                      />
                    </div>
                    <div className="form-group">
                      <label htmlFor="name">Email:</label>
                      <input
                        type="text"
                        className="form-control"
                        id="name"
                        name="name"
                        value={selectedData.tc_e_id}
                        onChange={(e) =>
                          setSelectedData({
                            ...selectedData,
                            tc_e_id: e.target.value,
                          })
                        }
                      />
                    </div>
                    <div className="form-group">
                      <label htmlFor="name">Address:</label>
                      <input
                        type="text"
                        className="form-control"
                        id="name"
                        name="name"
                        value={selectedData.tc_address}
                        onChange={(e) =>
                          setSelectedData({
                            ...selectedData,
                            tc_address: e.target.value,
                          })
                        }
                      />
                    </div>
                  </form>
                )}
              </div>
              <div className="modal-footer">
                <button
                  type="button"
                  className="btn btn-secondary"
                  onClick={handleCloseModal}
                >
                  Close
                </button>
                <button
                  type="button"
                  className="btn btn-primary"
                  onClick={handleUpdateData}
                >
                  Update
                </button>
              </div>
            </div>
          </div>
        </div>

        {/* Modal backdrop */}
        <div
          className={modal-backdrop ${modalOpen ? "show" : ""}}
          style={{ display: modalOpen ? "block" : "none" }}
        ></div>
      </>

      {/*  */}
      {/* //! */}

      <div id="main-content">
        <div className="row clearfix">
          <div className="col-lg-12 col-md-12">
            <div className="card planned_task">
              {/*  */}
              <div className="container-fluid">
                <div className="block-header">
                  <div className="row clearfix">
                    <div className="col-md-6 col-sm-12">
                      <h1>Clients</h1>
                      <nav aria-label="breadcrumb">
                        <ol className="breadcrumb">
                          <li className="breadcrumb-item">
                            <Link to="/dashboard">
                              <i className="icon-home"> </i>
                            </Link>
                          </li>
                          <li className="breadcrumb-item">Dashboard</li>
                          <li className="breadcrumb-item active">Clients</li>
                        </ol>
                      </nav>
                    </div>

                    {/* //! Create Clients model  button  */}

                    <div
                      className="col-md-6 col-sm-12 text-right hidden-xs"
                      // onClick={handleCreateButtonOpen}
                    >
                      <div className="d-flex flex-row-reverse">
                        <button
                          onClick={handleCreateButtonOpen}
                          className="btn btn-success ml-1 mr-1"
                          data-toggle="modal"
                          // data-target=".bd-example-modal-lg"
                        >
                          <i className="icon-plus"></i> Create Clients
                        </button>
                        {/* //! Create Clients  model */}

                        {/*  */}
                        {/* //! Edit user model */}

                        {/*  */}
                      </div>
                    </div>

                    {/*  !------------------------------ */}
                  </div>
                </div>

                <>
                  <div
                    className={modal ${create_modalOpen ? "show" : ""}}
                    tabIndex="-1"
                    role="dialog"
                    style={{
                      display: create_modalOpen ? "block" : "none",
                    }}
                  >
                    <div className="modal-dialog modal-lg">
                      <div className="modal-content">
                        <div className="modal-header">
                          <h5 className="modal-title h4" id="myLargeModalLabel">
                            New Client
                          </h5>
                          <button
                            type="button"
                            className="close"
                            // data-dismiss="modal"
                            // aria-label="Close"
                            onClick={handleCreateButtonClose}
                          >
                            <span aria-hidden="true">×</span>
                          </button>
                        </div>
                        <div className="modal-body">
                          {/*  */}

                          <form onSubmit={onSubmitChange}>
                            <div className="form-group">
                              <label
                                for="exampleInputEmail1"
                                className="d-flex"
                              >
                                Client Name
                              </label>
                              <input
                                type="text"
                                className="form-control"
                                id="exampleInputEmail1"
                                aria-describedby="emailHelp"
                                placeholder="Client Name"
                                name="user_name"
                                onChange={(e) => changeUserFieldHandler(e)}
                                required
                              />
                            </div>
                            <div className="form-group">
                              <label
                                for="exampleInputPassword1"
                                className="d-flex"
                              >
                                Phone Number
                              </label>
                              <input
                                type="tel"
                                // pattern="[0-9]{10}"
                                min={10}
                                maxLength={10}
                                className="form-control"
                                // id="exampleInputPassword1"
                                placeholder=" Client Number"
                                name="user_m_no"
                                onChange={(e) => changeUserFieldHandler(e)}
                                required
                              />
                            </div>

                            {/*  */}
                            <div className="form-group">
                              <label
                                for="exampleInputPassword1"
                                className="d-flex"
                              >
                                WhatsApp Number
                              </label>
                              <input
                                type="tel"
                                // pattern="[0-9]{10}"
                                min={10}
                                maxLength={10}
                                className="form-control"
                                // id="exampleInputPassword1"
                                placeholder=" Client Number"
                                name="user_w_name"
                                onChange={(e) => changeUserFieldHandler(e)}
                                required
                              />
                            </div>
                            {/*  */}
                            <div className="form-group">
                              <label
                                for="exampleInputPassword1"
                                className="d-flex"
                              >
                                Email
                              </label>
                              <input
                                type="email"
                                className="form-control"
                                id="exampleInputPassword1"
                                placeholder=" Client Email"
                                name="user_e_nid"
                                onChange={(e) => changeUserFieldHandler(e)}
                                required
                              />
                            </div>
                            {/*  */}

                            <div className="form-group">
                              <label
                                for="exampleInputPassword1"
                                className="d-flex"
                              >
                                Client Address
                              </label>
                              <input
                                type="text"
                                className="form-control"
                                id="exampleInputPassword1"
                                placeholder=" Client Address"
                                name="user_a"
                                onChange={(e) => changeUserFieldHandler(e)}
                                required
                              />
                            </div>
                            {/*  */}
                            <div className="modal-footer">
                              <button
                                type="submit"
                                className="btn btn-primary pl-5
                                      pr-5
                                      pt-2
                                      pb-2"
                                onClick={handleCreateButtonClose}
                              >
                                Add
                              </button>
                            </div>
                          </form>

                          {/*  */}
                        </div>
                      </div>
                    </div>
                  </div>

                  <div
                    className={`modal-backdrop ${
                      create_modalOpen ? "show" : ""
                    }`}
                    style={{
                      display: create_modalOpen ? "block" : "none",
                    }}
                  ></div>
                </>

                {/*  */}
                <div className="table-responsive">
                  <table className="table table-striped">
                    <thead>
                      <tr>
                        <th>Id</th>
                        <th>NAME</th>
                        <th>Mobile Number</th>
                        <th>Whatsapp Number</th>
                        <th>Email</th>
                        <th>Address</th>
                        <th>Action</th>
                        <td></td>
                      </tr>
                    </thead>
                    <tbody>
                      {userData.length > 0 ? (
                        userData.map((item, i) => (
                          <tr key={i}>
                            <td>{item.tc_id}</td>
                            <td>{item.tc_name}</td>
                            <td>{item.tc_m_no}</td>
                            <td>{item.tc_w_no}</td>
                            <td>{item.tc_e_id}</td>
                            <th>{item.tc_address}</th>
                            <td>
                              <button
                                data-toggle="modal"
                                data-target=".bd-example-modal-lg2"
                                className="btn btn-success ml-1 mr-1"
                                data-backdrop="static"
                                data-keyboard="false"
                                onClick={() => handleEditClick(item.tc_id)}
                              >
                                Edit
                              </button>
                            </td>
                            <td>
                              <button
                                className="btn btn-danger btn-round ml-1 mr-1"
                                onClick={() => deleteData(item.tc_id)}
                              >
                                Delete
                              </button>
                            </td>
                          </tr>
                        ))
                      ) : (
                        <>
                          <tr>
                            <td colSpan={8} className="text-center">
                              No data available
                            </td>
                          </tr>
                        </>
                      )}
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>

        <ToastContainer
          position="top-right"
          autoClose={5000}
          hideProgressBar={false}
          newestOnTop={false}
          closeOnClick
          rtl={false}
          pauseOnFocusLoss
          draggable
          pauseOnHover
          theme="colored"
          // transition: Bounce,
        />
      </div>
    </>
  );
}

export default Client
const getData = require('../js/utility/getData');

module.exports = class Data {

  static getPartnerData() {
    return getData.getFileData().partners;
  }

  static getServicesData() {
    return getData.getFileData().services;
  }

  static getPricingData() {
    return getData.getFileData().prices;
  }

  static getFeatures() {
    return getData.getFileData().features;
  }

  static getValues() {
    return getData.getFileData().values;
  }

  static getStats() {
    return getData.getFileData().stats;
  }
}
const data = require('../models/data');

exports.getAbout = (req, res) => {

  let values = data.getValues();
  let stats = data.getStats();
  let firstArr = values.slice(0,2);
  let secondArr = values.slice(2,4);

  res.render('pages/about', 
    {
      firstArr,
      stats,
      secondArr
    }
  )
}
import StoreKit

//inside viewController
let productId = "your_product_id"


//Action where you want to trigger the purchase
@IBAction func btn_OneTimeButtonClicked(_ sender: UIButton) {
	if SKPaymentQueue.canMakePayments(){
		let paymentRequest = SKMutablePayment()
		paymentRequest.productIdentifier = productId
		SKPaymentQueue.default().add(paymentRequest)
	}
}

//extension to handle the transaction states

extension your_View_Controller: SKPaymentTransactionObserver{
    func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
        transactions.forEach { transaction in
            switch transaction.transactionState{
            case .purchasing:
                print("purchasing now ...")
            case .purchased:
                print("purchase successful !!!")
            case .failed:
                print("purchase failed !!!")
            case .restored:
                print("purchase restored !!!")
            case .deferred:
                print("purchase deferred !!!")
            @unknown default:
                print("Unknown error")
            }
        }
    }
}

// don't forgot to add storekit configuration file in your app if you are testing your app in simulator

with Produce AS (
  SELECT 'Kale' as product, 'good' as sales, 'Q1' as quarter UNION ALL
  SELECT 'Kale', 'bad', 'Q2' UNION ALL
  SELECT 'Kale', 'good', 'Q3' UNION ALL
  SELECT 'Kale', 'bad', 'Q4' UNION ALL
  SELECT 'Apple', 'bad', 'Q1' UNION ALL
  SELECT 'Apple', 'good', 'Q2' UNION ALL
  SELECT 'Apple', 'bad', 'Q3' UNION ALL
  SELECT 'Apple', 'good', 'Q4')
SELECT * FROM
  (SELECT product, sales, quarter FROM Produce)
  PIVOT(MAX(sales) FOR quarter IN ('Q1', 'Q2', 'Q3', 'Q4'))
WITH cte AS (
    SELECT *, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) rn
    FROM (SELECT attribute AS attr1, value AS val1 FROM temp WHERE attribute = 'height') t1
    CROSS JOIN (SELECT attribute AS attr2, value AS val2 FROM temp WHERE attribute = 'weight') t2
    CROSS JOIN (SELECT attribute AS attr3, value AS val3 FROM temp WHERE attribute = 'gender') t3
)

SELECT rn AS Combination, attr1 AS Attribute, val1 AS Value FROM cte WHERE attr1 = 'height' UNION ALL
SELECT rn, attr2, val2 FROM cte WHERE attr2 = 'weight' UNION ALL
SELECT rn, attr3, val3 FROM cte WHERE attr3 = 'gender'
ORDER BY Combination, Attribute, Value;
SELECT
   CCY1, CCY2, CER.Exchange_Rate
FROM
    ( 
    SELECT
        c1.rec_id AS rec_id1, c1.currency AS CCY1,
        c2.rec_id AS rec_id2, c2.currency AS CCY2
    FROM
        currency c1
        CROSS JOIN --all combinations...
        currency c2
    WHERE
        c1.rec_id <> c2rec_id -- ...removes same pairs
    ) foo
    LEFT JOIN -- ...get matching FX pairs
    CurrencyExchangeRate CER ON foo.rec_id1 = cer.[from] AND foo.rec_id2 = cer.[to]
star

Thu Apr 11 2024 09:01:00 GMT+0000 (Coordinated Universal Time)

@Justus #apex

star

Thu Apr 11 2024 08:31:15 GMT+0000 (Coordinated Universal Time)

@HTPrince

star

Thu Apr 11 2024 08:02:17 GMT+0000 (Coordinated Universal Time)

@HTPrince

star

Thu Apr 11 2024 07:59:26 GMT+0000 (Coordinated Universal Time) https://www.kurazone.net/2020/12/cara-membuat-widget-random-posts.html

@Gelmi #html

star

Thu Apr 11 2024 06:41:15 GMT+0000 (Coordinated Universal Time)

@HTPrince

star

Thu Apr 11 2024 06:41:12 GMT+0000 (Coordinated Universal Time)

@kervinandy123 #c

star

Thu Apr 11 2024 06:05:06 GMT+0000 (Coordinated Universal Time)

@kervinandy123 #c

star

Thu Apr 11 2024 01:28:02 GMT+0000 (Coordinated Universal Time) https://urvsso.urv.cat/cas/idp/profile/SAML2/Callback?entityId

@Dasaju

star

Thu Apr 11 2024 01:01:22 GMT+0000 (Coordinated Universal Time)

@CarlosR

star

Wed Apr 10 2024 23:03:10 GMT+0000 (Coordinated Universal Time)

@rafal_rydz

star

Wed Apr 10 2024 22:41:07 GMT+0000 (Coordinated Universal Time)

@v0xel #c#

star

Wed Apr 10 2024 14:30:39 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/fr-fr/dotnet/api/system.windows.forms.listview.-ctor?view

@demelevet

star

Wed Apr 10 2024 14:28:47 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/fr-fr/dotnet/api/system.windows.forms.view?view

@demelevet #colors

star

Wed Apr 10 2024 14:26:49 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/fr-fr/dotnet/api/system.windows.forms.listview.view?view

@demelevet

star

Wed Apr 10 2024 14:25:41 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/fr-fr/dotnet/api/system.windows.forms.listview?view

@demelevet

star

Wed Apr 10 2024 13:22:40 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #css

star

Wed Apr 10 2024 11:24:10 GMT+0000 (Coordinated Universal Time)

@Paloma #js

star

Wed Apr 10 2024 07:07:17 GMT+0000 (Coordinated Universal Time) https://chen-studio.co.il/wp-admin/admin.php?page

@chen #undefined

star

Wed Apr 10 2024 05:44:26 GMT+0000 (Coordinated Universal Time)

@naeemi7

star

Wed Apr 10 2024 05:35:15 GMT+0000 (Coordinated Universal Time) https://book.getfoundry.sh/forge/deploying

@katyno

star

Wed Apr 10 2024 05:35:11 GMT+0000 (Coordinated Universal Time) https://book.getfoundry.sh/forge/deploying

@katyno

star

Wed Apr 10 2024 05:34:43 GMT+0000 (Coordinated Universal Time) https://medium.com/@saadjamilakhtar/optimizing-django-performance-tips-and-techniques-for-blazing-fast-applications-ab6e5d5af799

@viperthapa #python

star

Wed Apr 10 2024 05:34:17 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #jquery

star

Wed Apr 10 2024 02:56:08 GMT+0000 (Coordinated Universal Time) https://www.w3schools.com/tags/tag_button.asp

@skatzy

star

Wed Apr 10 2024 02:55:46 GMT+0000 (Coordinated Universal Time) https://www.geeksforgeeks.org/how-to-show-images-on-click-using-html/#

@skatzy

star

Tue Apr 09 2024 23:29:21 GMT+0000 (Coordinated Universal Time)

@rafal_rydz

star

Tue Apr 09 2024 11:28:28 GMT+0000 (Coordinated Universal Time)

@zaki

star

Tue Apr 09 2024 10:27:03 GMT+0000 (Coordinated Universal Time)

@MrSpongeHead

star

Tue Apr 09 2024 10:07:45 GMT+0000 (Coordinated Universal Time)

@zaki

star

Tue Apr 09 2024 07:47:41 GMT+0000 (Coordinated Universal Time)

@divyasoni23 #jquery

star

Tue Apr 09 2024 07:34:17 GMT+0000 (Coordinated Universal Time) https://wordpress.stackexchange.com/questions/228591/to-perform-the-requested-action-wordpress-needs-to-access-your-web-server-pleas

@ioVista

star

Tue Apr 09 2024 07:24:08 GMT+0000 (Coordinated Universal Time)

@Saurabh_Lodhi #swift #inapppurchase

star

Tue Apr 09 2024 03:15:39 GMT+0000 (Coordinated Universal Time) https://www.google.com/maps/@42.0201354,-70.9238472,3a,19.7y,180.8h,93.99t/data

@docpainting

star

Tue Apr 09 2024 01:30:23 GMT+0000 (Coordinated Universal Time)

@davidmchale #custom #properties

star

Tue Apr 09 2024 01:29:12 GMT+0000 (Coordinated Universal Time)

@davidmchale #random #image #url

star

Mon Apr 08 2024 20:32:59 GMT+0000 (Coordinated Universal Time)

@jamzlego #nodejs

star

Mon Apr 08 2024 16:41:27 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github

@CarlosR

star

Mon Apr 08 2024 16:37:48 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/migrations/importing-source-code/using-the-command-line-to-import-source-code/adding-locally-hosted-code-to-github

@CarlosR

star

Mon Apr 08 2024 15:36:29 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/sv-se/windows/apps/get-started/developer-mode-features-and-debugging#additional-developer-mode-features

@dw

star

Mon Apr 08 2024 15:31:50 GMT+0000 (Coordinated Universal Time)

@jamzlego #nodejs

star

Mon Apr 08 2024 15:30:34 GMT+0000 (Coordinated Universal Time)

@codeing

star

Mon Apr 08 2024 14:38:43 GMT+0000 (Coordinated Universal Time)

@jamzlego #nodejs

star

Mon Apr 08 2024 14:35:20 GMT+0000 (Coordinated Universal Time)

@jamzlego #nodejs

star

Mon Apr 08 2024 11:48:34 GMT+0000 (Coordinated Universal Time)

@Saurabh_Lodhi #swift #inapppurchase

star

Mon Apr 08 2024 11:37:55 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/67715555/big-query-pivot-operator-how-do-i-make-it-work-when-column-data-type-is-string

@flaviobrito

star

Mon Apr 08 2024 10:28:16 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/cryptocurrency-exchange-development-company

@Elizebeth #web3 #cryptocurrencyexchange development company #cryptocurrencyexchange software development company #cryptocurrency exchange development services

star

Mon Apr 08 2024 10:27:32 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/63447213/generate-all-combinations

@flaviobrito #sql

star

Mon Apr 08 2024 10:26:05 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2258735/how-to-create-a-query-to-list-all-combinations-possibilities

@flaviobrito #sql

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension