Snippets Collections
import random
while True:     
     print("Throw the dice by pressing enter")
     input()
     dice1=random.randint(1,6)
     dice2=random.randint(1,6)
     roll=dice1+dice2
     print("You have rolled", dice1, "and" , dice2, "=",roll)
     if roll==7 or roll==11:
         print("You have won with the first try!")
         break
     elif roll==2 or roll==3 or roll==12:
         print("You have lost with the first try!")
         break
     else:
         print("Throw the dice again. It must be", roll)
git reset --hard bbc7616a7d1a2d92b6e88aabe0a54fb63ac92474
git checkout master
git reset --hard e3f1e37
git push --force origin master
# Then to prove it (it won't print any diff)
git diff master..origin/master
const text = "codetogo saved me tons of time";

text.replace(/ /g, "-");
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page

class ProductListAPIView(generics.ListAPIView):
    serializer_class = ProductSerializer

    @method_decorator(cache_page(60))
    def dispatch(self, *args, **kwargs):
        return super(ProductListAPIView, self).dispatch(*args, **kwargs)
<?php  

    // PAGINATION CODE

    $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;

    $mainarray = array(

        'post_type' => array('post'),

        'post_status' => array('publish'),

        'orderby' => 'date',

        'order' => 'DESC',

        'posts_per_page' => 6,

        'paged'       => $paged,

    );

    $q = new WP_Query($mainarray); 

?>

​

    <div class="row custom-blog-main-wrapper">

        <?php while ($q->have_posts()) : $q->the_post(); ?>

        <div class="col-md-4 col-sm-6">

            <div class="blog-news-wrapper">

                <div class="blog-image">

                    <a href="<?php the_permalink(); ?>">

                        <?php if (has_post_thumbnail()):

$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(),'large', true);

?>

                        <img src="<?php echo $thumbnail[0]; ?>" alt="Picture" class="featured-image">

                        <?php else: ?>

                        <img src="<?php echo site_url('PATH'); ?>" alt="Picture" class="featured-image">

                        <?php endif; ?>

                    </a>

                </div>

                <div class="blog-content">

                    <p class="blog-date">

                        <?php echo get_the_date('M d Y'); ?>

                    </p>

                    <h3 class="blog-title">

                        <a href="<?php the_permalink(); ?>">

                            <?php the_title(); ?>

                        </a>

                    </h3>

                    <div class="blog-inner">

                        <p class="blog-text">

                            <?php if(!empty(get_the_excerpt())){

                                echo strip_tags(substr(get_the_excerpt(), 0, 200));

                            }

                            else{
<?xml version="1.0" encoding="windows-874"?>
<HOSXP2LIS>
     <Header>
          <Sender>HOSxP</Sender>
          <Receiver>LIS</Receiver>
          <Pattern>P</Pattern>
          <GenerateDate>2022-11-18</GenerateDate>
          <GenerateTime>14:43:30</GenerateTime>
     </Header>
     <Patient>
          <LabOrderNo>875452</LabOrderNo>
          <HOSxP4LISNO>875452</HOSxP4LISNO>
          <HN>0129120</HN>
          <VN>651118132240</VN>
          <AN></AN>
          <TypeID>05</TypeID>
          <TypeName>เบิกได้ (ตรวจสุขภาพ)</TypeName>
          <Name>
               <Title>นาย</Title>
               <FirstName>ชาคริต</FirstName>
               <MidName></MidName>
               <LastName>เสนาสังข์</LastName>
               <Cid>1310600035021</Cid>
          </Name>
          <BirthDate>1985-12-15</BirthDate>
          <Sex>M</Sex>
          <Age>36</Age>
          <Weight></Weight>
          <Height></Height>
          <Nationality>ไทย</Nationality>
          <Address>
               <AddressCode>312001</AddressCode>
               <HomeNo>115</HomeNo>
               <village>โนนดินแดง</village>
               <District>โนนดินแดง</District>
               <Province>บุรีรัมย์</Province>
               <PostCode> </PostCode>
          </Address>
          <Doctor>
               <Code>429</Code>
               <Name>นายชาคริต เสนาสังข์</Name>
          </Doctor>
          <DiagCode></DiagCode>
          <DiagName></DiagName>
          <OrderDate>2022-11-18</OrderDate>
          <OrderTime>14:38:40</OrderTime>
          <ReceiveOrderDate>2022-11-18</ReceiveOrderDate>
          <ReceiveOrderTime>14:38:40</ReceiveOrderTime>
          <Priority>0</Priority>
          <Section>OPD</Section>
          <DepCode>016</DepCode>
          <DepName>หน้าห้องตรวจ</DepName>
          <WardEcode>002</WardEcode>
          <WardEcodeName></WardEcodeName>
          <BedNo></BedNo>
          <Comment>ทดสอบ 2</Comment>
          <Computer>LAB-COUNTER1</Computer>
     </Patient>
     <LabOrder>
          <SeqNo>1</SeqNo>
          <LabOrderNo>875452</LabOrderNo>
          <ItemEcode>i14</ItemEcode>
          <ItemType>ITEM</ItemType>
          <ItemRefName>![CDATA[Glucose (POCT)]]</ItemRefName>
          <LabType>B</LabType>
          <Action>A</Action>
          <SpecimenCode>35</SpecimenCode>
          <Comment></Comment>
     </LabOrder>
</HOSXP2LIS>
<?xml version="1.0" encoding="windows-874"?>
<HOSXP2LIS>
     <Header>
          <Sender>HOSxP</Sender>
          <Receiver>LIS</Receiver>
          <Pattern>P</Pattern>
          <GenerateDate>2022-11-18</GenerateDate>
          <GenerateTime>14:43:30</GenerateTime>
     </Header>
     <Patient>
          <LabOrderNo>875452</LabOrderNo>
          <HOSxP4LISNO>875452</HOSxP4LISNO>
          <HN>0129120</HN>
          <VN>651118132240</VN>
          <AN></AN>
          <TypeID>05</TypeID>
          <TypeName>เบิกได้ (ตรวจสุขภาพ)</TypeName>
          <Name>
               <Title>นาย</Title>
               <FirstName>ชาคริต</FirstName>
               <MidName></MidName>
               <LastName>เสนาสังข์</LastName>
               <Cid>1310600035021</Cid>
          </Name>
          <BirthDate>1985-12-15</BirthDate>
          <Sex>M</Sex>
          <Age>36</Age>
          <Weight></Weight>
          <Height></Height>
          <Nationality>ไทย</Nationality>
          <Address>
               <AddressCode>312001</AddressCode>
               <HomeNo>115</HomeNo>
               <village>โนนดินแดง</village>
               <District>โนนดินแดง</District>
               <Province>บุรีรัมย์</Province>
               <PostCode> </PostCode>
          </Address>
          <Doctor>
               <Code>429</Code>
               <Name>นายชาคริต เสนาสังข์</Name>
          </Doctor>
          <DiagCode></DiagCode>
          <DiagName></DiagName>
          <OrderDate>2022-11-18</OrderDate>
          <OrderTime>14:38:40</OrderTime>
          <ReceiveOrderDate>2022-11-18</ReceiveOrderDate>
          <ReceiveOrderTime>14:38:40</ReceiveOrderTime>
          <Priority>0</Priority>
          <Section>OPD</Section>
          <DepCode>016</DepCode>
          <DepName>หน้าห้องตรวจ</DepName>
          <WardEcode>002</WardEcode>
          <WardEcodeName></WardEcodeName>
          <BedNo></BedNo>
          <Comment>ทดสอบ 2</Comment>
          <Computer>LAB-COUNTER1</Computer>
     </Patient>
     <LabOrder>
          <SeqNo>1</SeqNo>
          <LabOrderNo>875452</LabOrderNo>
          <ItemEcode>i14</ItemEcode>
          <ItemType>ITEM</ItemType>
          <ItemRefName>![CDATA[Glucose (POCT)]]</ItemRefName>
          <LabType>B</LabType>
          <Action>A</Action>
          <SpecimenCode>35</SpecimenCode>
          <Comment></Comment>
     </LabOrder>
</HOSXP2LIS>
<?xml version="1.0" encoding="windows-874"?>
<HOSXP2LIS>
     <Header>
          <Sender>HOSxP</Sender>
          <Receiver>LIS</Receiver>
          <Pattern>P</Pattern>
          <GenerateDate>2022-11-18</GenerateDate>
          <GenerateTime>13:40:27</GenerateTime>
     </Header>
     <Patient>
          <LabOrderNo>875433</LabOrderNo>
          <HOSxP4LISNO>875433</HOSxP4LISNO>
          <HN>0129120</HN>
          <VN>651118132240</VN>
          <AN></AN>
          <TypeID>05</TypeID>
          <TypeName>เบิกได้ (ตรวจสุขภาพ)</TypeName>
          <Name>
               <Title>นาย</Title>
               <FirstName>NAME</FirstName>
               <MidName></MidName>
               <LastName>เXXข์</LastName>
               <Cid>131XXXXX35021</Cid>
          </Name>
          <BirthDate>1985-12-15</BirthDate>
          <Sex>M</Sex>
          <Age>36</Age>
          <Weight></Weight>
          <Height></Height>
          <Nationality>ไทย</Nationality>
          <Address>
               <AddressCode>312001</AddressCode>
               <HomeNo>115</HomeNo>
               <village>โนนดินแดง</village>
               <District>โนนดินแดง</District>
               <Province>บุรีรัมย์</Province>
               <PostCode> </PostCode>
          </Address>
          <Doctor>
               <Code>429</Code>
               <Name>นายXXXX</Name>
          </Doctor>
          <DiagCode></DiagCode>
          <DiagName></DiagName>
          <OrderDate>2022-11-18</OrderDate>
          <OrderTime>13:23:34</OrderTime>
          <ReceiveOrderDate>2022-11-18</ReceiveOrderDate>
          <ReceiveOrderTime>13:23:34</ReceiveOrderTime>
          <Priority>0</Priority>
          <Section>OPD</Section>
          <DepCode>016</DepCode>
          <DepName>หน้าห้องตรวจ</DepName>
          <WardEcode>002</WardEcode>
          <WardEcodeName></WardEcodeName>
          <BedNo></BedNo>
          <Comment></Comment>
          <Computer>LAB-COUNTER1</Computer>
     </Patient>
     <LabOrder>
          <SeqNo>1</SeqNo>
          <LabOrderNo>875433</LabOrderNo>
          <ItemEcode>i7</ItemEcode>
          <ItemType>ITEM</ItemType>
          <ItemRefName>![CDATA[FBS]]</ItemRefName>
          <LabType>B</LabType>
          <Action>A</Action>
          <SpecimenCode>11</SpecimenCode>
          <Comment></Comment>
     </LabOrder>
</HOSXP2LIS>
// ==UserScript==
// @name         Close Tab Script
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Closes current tab when triggered
// @author       Mackey Johnstone
// @match        http://localhost/index.php
// @grant        window.close
// @require      http://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

(function() {
    'use strict';
    $("#close_page").click(function() {
        var confirm_result = confirm("Are you sure you want to quit?");
        if (confirm_result == true) {
            window.close();
        }
    });
})();
!pip install jupyter_contrib_nbextensions
!pip install jupyter-nbextensions-configurator
!jupyter contrib nbextension install --user
!jupyter nbextensions_configurator enable
.imp-label-email:hover{
            content: '';
            background-color: black;
            color:#ffffff;
            padding: 5px;
            border-radius: 5px;
            width: 50px;
        }
<body>
    <div>
        <form action="">
          <label class="imp-label" for="name">Name</label>
          <input type="text" name="name" />
  
          <label class="imp-label-email" for="email">email</label>
          <input type="text" name="email" />
  
          <button class="btn btn-primary" data-tooltip="Tooltip" type="submit">Submit</button>
        </form> 
      </div> 
</body>
 .imp-label::before{
            content: 'Fullname';
            display: inline;
            background-color: black;
            color:#ffffff;
            padding: 5px;
            border-radius: 5px;
        }
<body>
    <div>
        <form action="">
          <label class="imp-label" for="name">Name</label>
          <input type="text" name="name" />
  
          <label for="email">email</label>
          <input type="text" name="email" />
  
          <button class="btn btn-primary" data-tooltip="Tooltip" type="submit">Submit</button>
        </form> 
      </div> 
</body>
.imp-label::after{
            content: 'Fullname';
            display: inline;
            background-color: black;
            color:#ffffff;
            padding: 5px;
            border-radius: 5px;         
        }
<body>
    <div>
        <form action="">
          <label class="imp-label" for="name">Name</label>
          <input type="text" name="name" />
  
          <label for="email">email</label>
          <input type="text" name="email" />
  
          <button class="btn btn-primary" data-tooltip="Tooltip" type="submit">Submit</button>
        </form> 
      </div> 
</body>
nvim --headless -c 'call mkdir(stdpath("config"), "p") | exe "edit" stdpath("config") . "/init.lua" | write | quit'
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
 -activate -configure -access -on \
 -configure -allowAccessFor -allUsers \
 -configure -restart -agent -privs -all
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off
Add-MailboxPermission -Identity kathleenr@contoso.onmicrosoft.com -User admin@contoso.onmicrosoft.com -AccessRights FullAccess -AutoMapping $false


Add-MailboxPermission -Identity jburnett@aagtech.io -User admin@jobsbackpacker.com.au -AccessRights FullAccess -AutoMapping $false
Remove-MailboxPermission -Identity kathleenr@contoso.onmicrosoft.com -User admin@contoso.onmicrosoft.com -AccessRights FullAccess


Remove-MailboxPermission -Identity cpura@imperium.com.au -User admin@jobsbackpacker.com.au -AccessRights FullAccess
Connect-ExchangeOnline -UserPrincipalName jburnett@aagtech.io -ShowProgress $true
Update-Module -Name ExchangeOnlineManagement -Scope CurrentUser
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-deactivate -configure -access -off
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-activate -configure -access -on \
-clientopts -setvnclegacy -vnclegacy yes \
-clientopts -setvncpw -vncpw mypasswd \
-restart -agent -privs -all
SELECT '2022' AS year, monthNo, kyc, catg as risk_catg, 'monthly' as Frequency, breaches, 'WalletTopupInstMonthly' as rule FROM
    (SELECT Z.catg, Z.kyc, monthNo, SUM(IF(Z.totInsUsed >= Z.limit, 1, 0)) AS breaches FROM
        (SELECT A.senderuserid, A.transaction_id, COUNT(DISTINCT AA.inst) AS totInsUsed,
        IF(B.hml_category IS NOT NULL, B.hml_category, 'LOW RISK') AS catg, 
        IF(C.kyc IS NOT NULL, C.kyc, 'FULL') AS kyc, month(A.txnTime) as monthNo,
        CASE WHEN B.hml_category = 'HIGH RISK' AND (C.kyc = 'FULL' OR C.kyc IS NULL) THEN 6 
        WHEN B.hml_category = 'MEDIUM RISK' AND (C.kyc = 'FULL' OR C.kyc IS NULL) THEN 8
        WHEN B.hml_category IS NULL AND (C.kyc = 'FULL' OR C.kyc IS NULL) THEN 10 
        WHEN B.hml_category = 'HIGH RISK' AND C.kyc = 'MIN' THEN 4 
        WHEN B.hml_category = 'MEDIUM RISK' AND C.kyc = 'MIN' THEN 5
        WHEN B.hml_category IS NULL AND C.kyc = 'MIN' THEN 6 
        END AS limit FROM
            (SELECT senderuserid, transaction_id, IF(senderglobalcardid IS NOT NULL, senderglobalcardid, sender_vpa) as inst, updated_date as txnTime
            from fraud.transaction_details_v3     
            where year(updated_date) = 2022 
            and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
            and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
            and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP') AND (upi_flag = 'TRUE' OR card_flag = 'TRUE'))A
        INNER JOIN
            (SELECT senderuserid, transaction_id, IF(senderglobalcardid IS NOT NULL, senderglobalcardid, sender_vpa) as inst, updated_date as txnTime
            from fraud.transaction_details_v3     
            where year(updated_date) = 2022 
            and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
            and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
            and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP') AND (upi_flag = 'TRUE' OR card_flag = 'TRUE'))AA
        ON A.senderuserid = AA.senderuserid AND A.inst <> AA.inst AND ((UNIX_TIMESTAMP(A.txnTime) - UNIX_TIMESTAMP(AA.txnTime))/2592000) BETWEEN 0 AND 1
        LEFT JOIN
            (SELECT DISTINCT senderuserid, hml_category  FROM fraud.hml_classification)B
        ON A.senderuserid = B.senderuserid
        LEFT JOIN
            (SELECT DISTINCT user_ext_id, IF(kyc in ('MIN_KYC', 'MIN_KYC_V2'), 'MIN', 'FULL') as kyc FROM users.users)C
        ON A.senderuserid = C.user_ext_id
        GROUP BY A.senderuserid, A.transaction_id, B.hml_category, C.kyc, month(A.txnTime))Z
    GROUP BY Z.catg, Z.kyc, monthNo)P
//HTML
<ul className='card'>
   <li>
    <img src={avatar_url} alt={login} />
      <div>
      <h4>{login}</h4>
 		<a href={html_url}>profile</a>
 	 </div>
  </li>
</ul>


.card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem auto;
}

.card li {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--clr-white);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  text-align: left;
}
background: repeating-linear-gradient
(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done)
SELECT '2022' AS year, monthNo, kyc, catg AS risk_catg, 'Monthly' as Frequency, SUM(IF(totAmt > IF(kyc = 'MIN', (10000 * 0.02), (100000 * 0.02)), 1, 0)) as breaches
, 'WalletTopupTxnAmtMonthly' as rule FROM
    (SELECT A.monthNo, IF(C.hml_category IS NOT NULL, C.hml_category, 'LOW RISK') AS catg, D.kyc,
    A.transaction_id, (A.amt + SUM(B.amt)) as totAmt FROM
        (SELECT DISTINCT senderuserid, transaction_id, month(updated_date) as monthNo, totaltransactionamount as amt, transaction_time as TxnTime
        from fraud.transaction_details_v3     
        where year(updated_date) = 2022 and month(updated_date) = 11
        and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
        and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
        and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP'))A
    LEFT JOIN
        (SELECT DISTINCT senderuserid, transaction_id, totaltransactionamount as amt, transaction_time as TxnTime
        from fraud.transaction_details_v3     
        where year(updated_date) = 2022 and month(updated_date) IN (11-1, 11)
        and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
        and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
        and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP'))B
    ON A.senderuserid = B.senderuserid AND ((UNIX_TIMESTAMP(A.txnTime) - UNIX_TIMESTAMP(B.txnTime))/2592000) BETWEEN 0 AND 1 
    LEFT JOIN
        (SELECT DISTINCT senderuserid, hml_category
        FROM fraud.hml_classification)C
    ON A.senderuserid = C.senderuserid
    LEFT JOIN
        (SELECT DISTINCT user_ext_id, IF(kyc in ('MIN_KYC', 'MIN_KYC_V2'), 'MIN', 'FULL') as kyc 
        FROM users.users
        WHERE wallet_id IS NOT NULL AND kyc in ('MIN_KYC', 'MIN_KYC_V2'))D
    ON A.senderuserid = D.user_ext_id
    GROUP BY A.monthNo, C.hml_category, D.kyc, A.transaction_id, A.amt)P
GROUP BY monthNo, kyc, catg
SELECT '2022' AS year, monthNo, P.kyc, P.catg as risk_catg
, 'PerTxn' as Frequency
, P.breaches, 'WalletTopupTxnAmtPerTxn' as rule FROM
    (SELECT Z.monthNo, Z.catg, Z.kyc, SUM(IF(Z.amt > Z.limit, 1, 0)) AS breaches FROM
        (SELECT A.monthNo, A.senderuserid, A.transaction_id, A.amt,
        IF(C.hml_category IS NOT NULL, C.hml_category, 'LOW RISK') AS catg,
        D.kyc,
        CASE WHEN C.hml_category = 'HIGH RISK' AND (D.kyc = 'FULL' OR D.kyc IS NULL) THEN 10000
        WHEN C.hml_category = 'MEDIUM RISK' AND (D.kyc = 'FULL' OR D.kyc IS NULL) THEN 15000
        WHEN C.hml_category IS NULL AND (D.kyc = 'FULL' OR D.kyc IS NULL) THEN 20000 
        WHEN C.hml_category = 'HIGH RISK' AND D.kyc = 'MIN' THEN 8000 
        WHEN C.hml_category = 'MEDIUM RISK' AND D.kyc = 'MIN' THEN 8000
        WHEN C.hml_category IS NULL AND D.kyc = 'MIN' THEN 10000
        END AS limit FROM
            (SELECT DISTINCT senderuserid, transaction_id, month(updated_date) as monthNo, totaltransactionamount as amt
            from fraud.transaction_details_v3     
            where year(updated_date) = 2022 and month(updated_date) = 11
            and sendertype = 'INTERNAL_USER' AND workflowtype = 'CONSUMER_TO_MERCHANT'
            and pay_transaction_status = 'COMPLETED' AND errorcode = 'SUCCESS'
            and receiveruser in ('PHONEPEWALLETTOPUP','NEXUSWALLETTOPUP')
            AND totaltransactionamount > 8000)A
        LEFT JOIN
            (SELECT DISTINCT senderuserid, hml_category
            FROM fraud.hml_classification)C
        ON A.senderuserid = C.senderuserid
        LEFT JOIN
            (SELECT DISTINCT user_ext_id, IF(kyc in ('MIN_KYC', 'MIN_KYC_V2'), 'MIN', 'FULL') as kyc 
            FROM users.users
            WHERE wallet_id IS NOT NULL AND kyc in ('MIN_KYC', 'MIN_KYC_V2'))D
        ON A.senderuserid = D.user_ext_id)Z
    GROUP BY Z.catg, Z.monthNo, Z.kyc)P
//HTML
  <div class="container">
      <ul class="list">
        <li class="list--item" draggable="true">1</li>
        <li class="list--item" draggable="true">2</li>
        <li class="list--item" draggable="true">3</li>
        <li class="list--item" draggable="true">4</li>
      </ul>
    </div>

//CSS
* {
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: min(90%, 500px);
  background-color: #333;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  padding: 1rem;
}

.list--item {
  padding: 1rem;
  background-color: #efefef;
}

.dragging {
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  transition: 0.3s;
}

//JS
const list = document.querySelector('.list');
const items = document.querySelectorAll('.list--item');

const getDragAfterElement = (y) => {
  //Selects all the elements in the container that are not being dragged
  const draggableElements = [
    ...list.querySelectorAll('.list--item:not(.dragging)'),
  ];

  //Loop through the elements' list and determine which single element is right after our mouse cursor based on the y position that we pass in
  return draggableElements.reduce(
    (closest, child) => {
      const box = child.getBoundingClientRect();
      //Get half of the box on the y axis
      const offset = y - box.top - box.height / 2;
      //First the number needs to be negative, that is how we know that we are hovering over another child element, but we need the closest one, so the one which offset is the smallest
      if (offset < 0 && offset > closest.offset) {
        return { offset: offset, element: child };
      } else {
        return closest;
      }
    },
    { offset: Number.NEGATIVE_INFINITY }
  ).element;
};

items.forEach((item) => {
  item.addEventListener('dragstart', () => {
    item.classList.add('dragging');
  });
  item.addEventListener('dragend', () => {
    item.classList.remove('dragging');
  });
});

list.addEventListener('dragover', (e) => {
  e.preventDefault();

  const draggable = document.querySelector('.dragging');

  const afterElement = getDragAfterElement(e.clientY);
  if (afterElement == null) {
    //going to be added as the last child if no element is after
    list.appendChild(draggable);
  } else {
    //going to be added as before the next element
    list.insertBefore(draggable, afterElement);
  }
});
docker pull mo/compliance/images/fleet-agent:v0.5.0-rc4
docker pull mo/edge/kubernetes-engine/mo-system/apps/sccm-mgmt-gateway:1.7.0
docker pull mo/edge/kubernetes-engine/mo-services/apps/mo-maintenance-api:1.2.0
docker pull mo/edge/kubernetes-engine/mo-services/apps/mo-backend:2.3.0
CASE WHEN "%IM0951%" = "Reactive" and "%IM0952%" = "-" and "%IM095%" = "-" THEN "Positive" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "Reactive" and "%IM095%" = "-" THEN "Positive" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "-" and "%IM095%" = "Reactive" THEN "Positive" 
WHEN "%IM0951%" = "Reactive" and "%IM0952%" = "Reactive" and "%IM095%" = "-" THEN "Positive" 
WHEN "%IM0951%" = "Reactive" and "%IM0952%" = "-" and "%IM095%" = "Reactive" THEN "Positive" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "Reactive" and "%IM095%" = "Reactive" THEN "Positive" 
WHEN "%IM0951%" = "Reactive" and "%IM0952%" = "Reactive" and "%IM095%" = "Reactive" THEN "Positive" 
WHEN "%IM0951%" = "Non-reactive" and "%IM0952%" = "-" and "%IM095%" = "-" THEN "Negative" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "Non-reactive" and "%IM095%" = "-" THEN "Negative" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "-" and "%IM095%" = "Non-reactive" THEN "Negative" 
WHEN "%IM0951%" = "Non-reactive" and "%IM0952%" = "Non-reactive" and "%IM095%" = "-" THEN "Negative" 
WHEN "%IM0951%" = "Non-reactive" and "%IM0952%" = "-" and "%IM095%" = "Non-reactive" THEN "Negative" 
WHEN "%IM0951%" = "-" and "%IM0952%" = "Non-reactive" and "%IM095%" = "Non-reactive" THEN "Negative" 
WHEN "%IM0951%" = "Non-reactive" and "%IM0952%" = "Non-reactive" and "%IM095%" = "Non-reactive" THEN "Negative" 
ELSE "Inconclusive" END
a[href="your url here"]{
    background:red;
}
SELECT
	dbo.tbl_lab_setup_Test.Test_Code,
	dbo.tbl_lab_setup_Test.Test_Name
FROM
	dbo.tbl_lab_setup_Test_Profile
INNER JOIN dbo.tbl_lab_setup_Test ON dbo.tbl_lab_setup_Test.Test_Code = dbo.tbl_lab_setup_Test_Profile.Test_Item_Code

WHERE
	dbo.tbl_lab_setup_Test_Profile.Test_Profile_Code = ---'CH1020'
SELECT
	lab_items_sub_group_list.lab_items_sub_group_code,
	lab_items_sub_group.lab_items_sub_group_name,
	lab_items.ecode,
	lab_items.lab_items_name,
	lab_items.lab_items_code,
	lab_items.display_order,
	lab_items.lab_items_normal_value,
	lab_items.possible_value,
	lab_items.lab_items_unit
FROM
	lab_items_sub_group_list
	INNER JOIN
	lab_items
	ON
		lab_items.lab_items_code = lab_items_sub_group_list.lab_items_code
	INNER JOIN
	lab_items_sub_group
	ON
		lab_items_sub_group_list.lab_items_sub_group_code = lab_items_sub_group.lab_items_sub_group_code
WHERE
	#.lab_items_sub_group_code IN (#'248','249','250')
	lab_items_sub_group_list.lab_items_sub_group_code ='250'
ORDER BY
	lab_items_sub_group_code ASC,
	lab_items.display_order ASC

/*
SELECT
	lab_items_sub_group_list.lab_items_sub_group_code,
	lab_items_sub_group.lab_items_sub_group_name,
	lab_items.ecode,
	lab_items.lab_items_name,
	lab_items.lab_items_code,
	lab_items.display_order,
	lab_items.lab_items_normal_value,
	lab_items.possible_value,
	lab_items.lab_items_unit
FROM
	lab_items_sub_group_list
	INNER JOIN
	lab_items
	ON
		lab_items.lab_items_code = lab_items_sub_group_list.lab_items_code
	INNER JOIN
	lab_items_sub_group
	ON
		lab_items_sub_group_list.lab_items_sub_group_code = lab_items_sub_group.lab_items_sub_group_code
WHERE
	lab_items_sub_group_list.lab_items_sub_group_code
	in(
	'247'
			)
ORDER BY
	lab_items_sub_group_code ASC,
	lab_items.display_order ASC

*/
/*
SELECT
lab_items_sub_group_list.lab_items_code,
lab_items.lab_items_code,
lab_items_sub_group_list.lab_items_sub_group_code,
lab_items.lab_items_name,
lab_items.ecode,
lab_items.display_order
FROM
lab_items_sub_group_list
INNER JOIN lab_items ON lab_items.lab_items_code = lab_items_sub_group_list.lab_items_code
WHERE
lab_items_sub_group_list.lab_items_sub_group_code = ---80
ORDER BY
lab_items.display_order ASC
*/
SELECT
lab_items_sub_group_list.lab_items_code,
lab_items.lab_items_code,
lab_items_sub_group_list.lab_items_sub_group_code,
lab_items.lab_items_name,
lab_items.ecode,
lab_items.display_order
FROM
lab_items_sub_group_list
INNER JOIN lab_items ON lab_items.lab_items_code = lab_items_sub_group_list.lab_items_code
WHERE
lab_items_sub_group_list.lab_items_sub_group_code = ---80
ORDER BY
lab_items.display_order ASC
CASE
WHEN "%IM0951%" = "Reactive" THEN
    "Positive"
    OR
WHEN "%IM0952%" = "Reactive"THEN
    "Positive"
    OR
WHEN "%IM095%" = "Reactive" THEN
    "Positive"
WHEN "%IM0951%" = "Non-reactive" THEN
    "Negative"
    OR
WHEN "%IM0952%" = "Non-reactive"THEN
    "Negative"
    OR
WHEN "%IM095%" = "Non-reactive" THEN
    "Negative"
ELSE
    "Inconclusive"
END
star

Fri Nov 18 2022 13:15:09 GMT+0000 (Coordinated Universal Time) https://www.levelupsalesforce.com/lwc-refresh-related-list

@pradeepkumar28

star

Fri Nov 18 2022 12:42:37 GMT+0000 (Coordinated Universal Time)

@giorgoskotsalis

star

Fri Nov 18 2022 11:48:08 GMT+0000 (Coordinated Universal Time) https://www.firebeetechnoservices.com/cryptocurrency-exchange-software-development-company

@Sophiafern #cryptocurrencyexchangedevelopmentcompany #cryptocurrencyexchangesoftwaredevelopmentcompany #cryptocurrencyexchangedevelopmentservices #p2pcryptoexchangedevelopmentcompany

star

Fri Nov 18 2022 11:26:58 GMT+0000 (Coordinated Universal Time)

@sebherrerabe

star

Fri Nov 18 2022 11:26:38 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/17667023/git-how-to-reset-origin-master-to-a-commit

@jacopo

star

Fri Nov 18 2022 08:50:34 GMT+0000 (Coordinated Universal Time) https://codetogo.io/

@virgiliocano #javascript

star

Fri Nov 18 2022 08:39:03 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/38320008/how-to-cache-django-rest-framework-api-calls

@jacopo #python

star

Fri Nov 18 2022 08:25:18 GMT+0000 (Coordinated Universal Time) https://eseospace.dev/websites/expertreputation/wp-admin/theme-editor.php?file

@deveseospace #php #html

star

Fri Nov 18 2022 07:54:34 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #xml

star

Fri Nov 18 2022 07:54:34 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #xml

star

Fri Nov 18 2022 07:08:18 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #xml

star

Fri Nov 18 2022 06:06:42 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window

@nathina

star

Fri Nov 18 2022 06:06:20 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window

@nathina

star

Fri Nov 18 2022 06:05:57 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window

@nathina

star

Fri Nov 18 2022 05:44:55 GMT+0000 (Coordinated Universal Time) towardsdatascience.com/three-jupyter-notebook-extensions-that-minimize-distractions-bd9ec98f0e2c

@Bharat

star

Fri Nov 18 2022 05:14:25 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Fri Nov 18 2022 05:13:34 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Fri Nov 18 2022 05:11:57 GMT+0000 (Coordinated Universal Time)

@jayasreekonduru ##html ##css

star

Fri Nov 18 2022 04:19:06 GMT+0000 (Coordinated Universal Time) https://vonheikemen.github.io/devlog/tools/build-your-first-lua-config-for-neovim/

@rbrooker #vim

star

Fri Nov 18 2022 03:36:42 GMT+0000 (Coordinated Universal Time) https://apple.stackexchange.com/questions/30238/how-to-enable-os-x-screen-sharing-vnc-through-ssh

@rbrooker #bsh #macos #commandline #vnc #remotemanagement #mac

star

Fri Nov 18 2022 03:35:52 GMT+0000 (Coordinated Universal Time) https://apple.stackexchange.com/questions/30238/how-to-enable-os-x-screen-sharing-vnc-through-ssh

@rbrooker #bsh #vnc #macos #remotemanagement

star

Fri Nov 18 2022 02:54:02 GMT+0000 (Coordinated Universal Time) https://drive.google.com/drive/folders/1eZuDK-6pOegNPDQICR-YL6nnJklqUlmO

@javier

star

Fri Nov 18 2022 01:40:18 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/outlook/troubleshoot/profiles-and-accounts/remove-automapping-for-shared-mailbox

@JasonB

star

Fri Nov 18 2022 01:39:29 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/outlook/troubleshoot/profiles-and-accounts/remove-automapping-for-shared-mailbox

@JasonB

star

Fri Nov 18 2022 01:30:13 GMT+0000 (Coordinated Universal Time) https://sqlundercover.com/2017/06/22/generating-random-numbers-for-each-row-over-a-specified-range-and-other-funky-stuff-you-can-do-with-them/

@p83arch

star

Fri Nov 18 2022 01:11:01 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view

@JasonB

star

Fri Nov 18 2022 01:10:20 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/exchange/connect-to-exchange-online-powershell?view

@JasonB

star

Fri Nov 18 2022 01:09:17 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view

@JasonB

star

Thu Nov 17 2022 22:38:28 GMT+0000 (Coordinated Universal Time) https://apple.stackexchange.com/questions/30238/how-to-enable-os-x-screen-sharing-vnc-through-ssh

@rbrooker #bsh #mac #vnc

star

Thu Nov 17 2022 22:38:13 GMT+0000 (Coordinated Universal Time) https://apple.stackexchange.com/questions/30238/how-to-enable-os-x-screen-sharing-vnc-through-ssh

@rbrooker #bsh #mac #vnc

star

Thu Nov 17 2022 19:03:52 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Thu Nov 17 2022 18:01:21 GMT+0000 (Coordinated Universal Time)

@Cchidozie #javascript #html

star

Thu Nov 17 2022 17:54:14 GMT+0000 (Coordinated Universal Time)

@kemalevrnn

star

Thu Nov 17 2022 13:15:01 GMT+0000 (Coordinated Universal Time) https://unix.stackexchange.com/questions/17255/is-there-a-command-to-list-all-open-displays-on-a-machine

@Nerkyator

star

Thu Nov 17 2022 12:09:14 GMT+0000 (Coordinated Universal Time) https://hiraniconfigmgr.com/postDetails/237/Checks-if-the-specified-SQL-Server-meets-the-minimum-requirements-for-site-upgrade

@D_GEIGER

star

Thu Nov 17 2022 12:08:44 GMT+0000 (Coordinated Universal Time) undefined

@D_GEIGER

star

Thu Nov 17 2022 12:04:40 GMT+0000 (Coordinated Universal Time) https://sdkman.io/install

@ngvnfgvbmh

star

Thu Nov 17 2022 11:51:48 GMT+0000 (Coordinated Universal Time) https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view

@D_GEIGER

star

Thu Nov 17 2022 11:13:43 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Thu Nov 17 2022 11:13:08 GMT+0000 (Coordinated Universal Time)

@shubhangi_burle

star

Thu Nov 17 2022 10:44:58 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v=jfYWwQrtzzY

@Kristi #js

star

Thu Nov 17 2022 09:54:09 GMT+0000 (Coordinated Universal Time)

@oce1907

star

Thu Nov 17 2022 09:42:00 GMT+0000 (Coordinated Universal Time) undefined

@kannas

star

Thu Nov 17 2022 09:07:38 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #sql

star

Thu Nov 17 2022 08:54:51 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/29331831/css-styling-a-link-based-on-its-href

@Sebhart #typography #css #fluid

star

Thu Nov 17 2022 08:52:51 GMT+0000 (Coordinated Universal Time)

@HUMRARE7

star

Thu Nov 17 2022 08:49:19 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #sql

star

Thu Nov 17 2022 08:47:46 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #sql

star

Thu Nov 17 2022 08:45:42 GMT+0000 (Coordinated Universal Time)

@HUMRARE7 #sql

Save snippets that work with our extensions

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