Snippets Collections
ANIMATION_TIMEOUT = parseInt(getComputedStyle(rootEl).getPropertyValue('--transition-duration'), 10);
curl -L https://gitignore.io/api/[好きな言語や環境名。カンマ区切りで複数にも対応] -o .gitignore
docker-compose run --rm frontend sh -c 'npx create-react-app プロジェクト名 --template typescript'
q
  const [queryData, setQueryData] = useState<UserQueryData>({
    is_active: null,
    pageIndex: 1,
    pageSize: 10,
    pages: 10,
    total: 0,
  });

  const { isPending, data: userData } = useGetAllUsers(
    {
      size: queryData.pageSize,
      page: queryData.pageIndex,
      search: debouncedResults,
      is_active: queryData.is_active,
    },
    {
      query: {
        queryKey: [
          queryKeys.getUser,
          queryData.pageSize,
          queryData.pageIndex,
          queryData.is_active,
          debouncedResults,
        ],
      },
    },
  );  



const handleUnselectAll = useCallback(() => {
    dataTableRef.current?.resetSelected();
  }, [dataTableRef]);

  useEffect(() => {
    if (selectedCells.length <= 0) {
      handleUnselectAll();
    }
  }, [selectedCells, handleUnselectAll]);

  const handlePaginationChange = (pageIndex: number) => {
    dataTableRef.current?.resetSelected();
    setSelectedCells([]);
    setQueryData((prevData) => {
      return { ...prevData, ...{ pageIndex } };
    });
  };

  const handleSelectChange = (pageSize: number) => {
    setQueryData((prevData) => ({ ...prevData, ...{ pageSize } }));
  };

  const onRowSelect = (checked: boolean, row: CategoriesCell) => {
    setSelectedCells((prevSelectedCells) => {
      const existsIndex = prevSelectedCells.findIndex(
        (item) => item.id === row.id,
      );

      if (checked) {
        if (existsIndex === -1) {
          return [...prevSelectedCells, row];
        }
        return prevSelectedCells;
      } else {
        if (existsIndex !== -1) {
          const updatedSelection = [...prevSelectedCells];
          updatedSelection.splice(existsIndex, 1);
          return updatedSelection;
        }
        return prevSelectedCells;
      }
    });
  };

  const onAllRowSelect = useCallback(
    (checked: boolean, rows: Row<MoodsCell>[]) => {
      if (checked) {
        const originalRows = rows.map((row) => row.original);
        const selectedIds: MoodsCell[] = [];
        originalRows.forEach((row) => {
          selectedIds.push(row);
        });
        setSelectedCells(selectedIds);
      } else {
        setSelectedCells([]);
      }
    },
    [],
  );
// 1. push()
// Appends one or more elements to the end of an array
let arr1 = [1, 2, 3];
arr1.push(4);
console.log(arr1); // [1, 2, 3, 4]

// 2. pop()
// Removes the last element from the array and returns it
let arr2 = [1, 2, 3];
let lastElement = arr2.pop();
console.log(lastElement); // 3
console.log(arr2); // [1, 2]

// 3. shift()
// Removes the first element from the array and returns it
let arr3 = [1, 2, 3];
let firstElement = arr3.shift();
console.log(firstElement); // 1
console.log(arr3); // [2, 3]

// 4. unshift()
// Appends one or more elements to the beginning of an array
let arr4 = [2, 3];
arr4.unshift(1);
console.log(arr4); // [1, 2, 3]

// 5. concat()
// Combines two or more arrays
let arr51 = [1, 2];
let arr52 = [3, 4];
let newArr5 = arr51.concat(arr52);
console.log(newArr5); // [1, 2, 3, 4]


// 6. slice()
// Returns a new array containing part of the original array
let arr6 = [1, 2, 3, 4];
let newArr6 = arr6.slice(1, 3);
console.log(newArr6); // [2, 3]

// 7. splice()
// Changes the contents of an array by removing, replacing, or adding new elements
let arr7 = [1, 2, 3, 4];
arr7.splice(1, 2, 'a', 'b');
console.log(arr7); // [1, 'a', 'b', 4]

// 8. forEach()
// Executes the specified function once for each element of the array
let arr8 = [1, 2, 3];
arr8.forEach(element => console.log(element));
// 1
// 2
// 3

// 9. map()
// Creates a new array with the results of calling the specified function for each element of the array
let arr9 = [1, 2, 3];
let newArr9 = arr9.map(element => element * 2);
console.log(newArr9); // [2, 4, 6]

// 10. filter()
// Creates a new array with all elements that passed the test implemented by the given function
let arr10 = [1, 2, 3, 4];
let newArr10 = arr10.filter(element => element % 2 === 0);
console.log(newArr10); // [2, 4]

// 11. reduce()
// Applies a function to each element of an array (from left to right) to reduce it to a single value
let arr11 = [1, 2, 3, 4];
let sum = arr11.reduce((accumulator, currentValue) => accumulator + currentValue, 0);
console.log(sum); // 10

// 12. find()
// Returns the first element of the array that satisfies the given function
let arr12 = [1, 2, 3, 4];
let found = arr12.find(element => element > 2);
console.log(found); // 3

// 13. findIndex()
// Returns the index of the first array element that satisfies the given function
let arr13 = [1, 2, 3, 4];
let index = arr13.findIndex(element => element > 2);
console.log(index); // 2

// 14. some()
// Checks whether at least one element of the array satisfies the condition implemented by the function
let arr14 = [1, 2, 3, 4];
let hasEven = arr14.some(element => element % 2 === 0);
console.log(hasEven); // true

// 15. every()
// Checks whether all elements of an array satisfy the condition implemented by the function
let arr15 = [1, 2, 3, 4];
let allEven = arr15.every(element => element % 2 === 0);
console.log(allEven); // false

// 16. sort()
// Sorts the elements of an array and returns the sorted array
let arr16 = [3, 1, 4, 2];
arr16.sort();
console.log(arr16); // [1, 2, 3, 4]

// 17. reverse()
// Reverses the order of the elements in the array
let arr17 = [1, 2, 3, 4];
arr17.reverse();
console.log(arr17); // [4, 3, 2, 1]

// 18. join()
// Combines all elements of the array into a row
let arr18 = [1, 2, 3, 4];
let str = arr18.join('-');
console.log(str); // "1-2-3-4"

// 19. includes()
// Tests whether an array contains a specified element
let arr19 = [1, 2, 3, 4];
let hasThree = arr19.includes(3);
console.log(hasThree); // true

// 20. flat()
// Creates a new array with all subarray elements submerged to the specified depth
let arr20 = [1, [2, [3, [4]]]];
let flatArr = arr20.flat(2);
console.log(flatArr); // [1, 2, 3, [4]]

// 21. flatMap()
// First, it displays each element using a function, and then sums the result into a new array
let arr21 = [1, 2, 3];
let flatMappedArr = arr21.flatMap(element => [element, element * 2]);
console.log(flatMappedArr); // [1, 2, 2, 4, 3, 6]
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "🌟 Melbourne Boost Day Reminder! 🌟"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good morning Melbourne!\n\n \n\n Get ready for another fantastic Boost Day with these exciting offerings: \n\n ☕ *Xero Café:* Enjoy delicious café-style beverages crafted by our skilled baristas, and sweet treats like Lemon Slices, Yo-Yo Biscuits (Gluten Free) and Almond Crescents \n\n 📋 *Weekly Café Special:* Indulge in a delicious Biscoff Latte! \n\n :breakfast: *Breakfast*: Start your day with a delicious breakfast spread provided by Kartel Catering from 8:30am - 10:30am in the L3 Kitchen/Breakout Space. \n\n :fruits: *Reminder:* we now have a Nutribullet blender! Create your perfect mix for a delicious smoothie using our fresh fruit delivered on Mondays and Wednesdays! \n\n Enjoy your delicious smoothies and remember to #washyourowncoffeecup and clean up after yourself so the next Xero can enjoy too!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
const htmlMurkup = '<p>Good</p>'
let quill = new Quill()
quill.container.firstChild.innerHTML = htmlMurkup
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Website</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }

        header{
            width: 100%;
            height: 40px;
            background-color:yellow;
            color: red;
            font-size: xx-large;
            font-weight: 700;
            text-align: center;
        }
        nav{
            width: 100%;
            height: 30px;
            background-color: aqua;
            display: flex;
            justify-content: center;
            align-items: center;
          

        }
        nav ul{
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;

        }
        nav ul li{
            text-decoration: none;
            list-style-type:none ;
        }
        style>
h1{
    color: aqua;
    background-color: yellow;
    font-size: 50px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
*{
    margin: 0;
    padding: 0;
}
.nav{
    display: flex;
    width: 100%;
    height: 50px;
    background-color: green;
    justify-content: space-around;
    align-items: center;

}
/* .nav>div:nth-child(1){
    margin-left: 10px;
}
.nav>div:last-child{
    margin-left: 150px;
} */

.nav > div{
    height: 25px;
    width: 75px;
    background-color: aqua;
    text-align: center;
}
.nav .green{
    background-color: green;
}
main{
    border: 2px solid black;
    width: 100%;
    height: 700px;
    display: flex;

}
.items{
    width: 25%;
    height: 700px;
    border: 2px solid black;
}
.promo{
    width: 25%;
    height: 700px;
    border: 2px solid black;
}
.content{
    width: 50%;
    height: 700px;
    border: 2px solid black;
}
.items ul li{
    margin: 27px;
}
h2{
    text-align: center;

}
.container{
    width: 100%;
    height: 550px;
    display: flex;
    flex-wrap: wrap;
    background-color: aqua;
    justify-content: space-around;

}
.box{
    


    width: 150px;
    height: 150px;
    background-color: chartreuse;
    margin: 20px;
    display: flex;
    gap: 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;

}

    </style>

</head>
<body>
    <header>
        Mycloth
    </header>
    <nav>
        <ul>
            <li>Home</li>
            <li>About us</li>
            <li>Investors</li>
            <li>Relations</li>
            <li>Our Story</li>
            <li>More info</li>
        </ul>



    </nav>
      
<main>

    <div class="items">
    
        <h2 >Offers</h2>
        <ul>
            <li> Get up to 10% discount</li>
            <li> Apply coupon:Fest</li>
            <li>get up to 20% off on ready made cloth </li>
            <li>sale starts on 29dec </li>
            <li>get 5% discount using cards </li>
        </ul>
    
    </div>
    
    
    <div class="content">
        <h2>Our Products</h2>
        <div class="container">
    
             <div class="box">
                <h5>Sports dresses</h5>
                <img src="dress.jfif" alt="" width="100px" height="90px">
                <button>Buy Now</button>
             </div>
             <div class="box">
                <h5>Sports dresses</h5>
                <img src="dress.jfif" alt="" width="100px" height="90px">
                <button>Buy Now</button>
             </div>

             <div class="box">
                <h5>Sports dresses</h5>
                <img src="dress.jfif" alt="" width="100px" height="90px">
                <button>Buy Now</button>
             </div>
        

        </div>
    
    
    </div>
    <div class="promo">
        <h2>Promotions</h2>
        <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Aspernatur est aliquid velit adipisci ipsam explicabo! Velit eos nostrum sapiente odio vitae nesciunt laborum dolorum incidunt facilis alias sint placeat corrupti ducimus tempora minima, animi totam nihil ea unde dignissimos adipisci commodi molestiae modi rem. Expedita saepe accusantium voluptate labore amet vitae, iusto ullam recusandae soluta nemo delectus eligendi vero ea a praesentium pariatur. Aperiam sed atque mollitia deleniti architecto odit possimus? Odio facilis corporis inventore unde possimus quis id, saepe doloribus dolores veniam illo, ea hic adipisci quibusdam quas eligendi ratione, eaque natus voluptate. Odit laborum nesciunt repudiandae accusamus. Temporibus nisi quas deserunt, optio adipisci facilis voluptatem quam eaque repellat exercitationem reiciendis, doloribus sit dolores blanditiis quae eum dolorem quibusdam vero voluptas molestias accusantium recusandae maxime aspernatur. Ipsa deleniti, quasi laboriosam optio voluptatem nihil accusamus iusto a corporis dignissimos facere vero voluptates rerum tempore porro! Beatae saepe adipisci praesentium commodi, officia dolore repellendus illo sint ab, id esse tempore tempora a facere, veritatis recusandae mollitia aspernatur unde? Maxime similique a voluptates facere, quos, molestias vitae tempore nihil eius saepe eos, assumenda accusamus libero numquam facilis in fuga quam ipsa sapiente esse! Veritatis nisi perferendis, libero sequi doloremque suscipit deleniti dolor.</p>
    
    </div>
    
    
    
    
    
    </main>



</body>
</html>
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":te-wiki-o-te-reo-maori: Boost Days - What's on this week! :te-wiki-o-te-reo-maori:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Happy Māori Language Week Te-Whanganui-a-tara! \n\nLet's make this week a great one with our Boost Day Program :zap: See below for what's coming up! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-17: Tuesday, 17th September",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Xero Café*: Café-style beverages and sweet treats\n:arrow-right: *Barista Special*: Irish Cream Coffee \n:sun_with_face: *Breakfast*: Provided by *Simply Food* from *8:00am - 10:30am* on Level 3\n :person_in_steamy_room: *Massage*: Book in with Justine <http://justinescottmassagetherapist.gettimely.com/|here> to secure a spot, please note this is not covered by WX \n :walking:*Steptember*: Participate in a 30 minute walk from the office at *3:00pm* led by Kimi Zerafat! \n :xero-boxing: *Boxing*: Xero led Boxing Session at 12pm in the XO Gym! \n:connect: *Boost Survey*: Official feedback survey released today, give us your thoughts <https://yourvoice.xero.com/jfe/form/SV_eyA8ArYHfnsfUwu|here> - form open until Friday October 18th "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-19: Thursday, 19th September",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Xero Café*: Café-style beverages and sweet treats \n:arrow-right: *Barista Special*: Irish Cream Coffee \n :little-bread-loaf: *Morning Tea*: Provided by our favourite Māori owned bakery, Little Bread Loaf, at *10:30am* on *Level 3* \n :film_projector: *AB & SB Product Vision*: Streamed in the *All Hands* at *10:45am*, grab a bite and a seat to view together!\n :kia-kaha-trm: *Online Session*: Join this virtual Te Reo Māori history session with Riki Consulting <https://calendar.google.com/calendar/event?action=TEMPLATE&tmeid=NjE2ajFiZDhwcmNlaGptaW1xNmd2ZWNjcXIgY18wamJma3B1cmhlOWJtZmpwOHJtbHFqYTlrOEBn&tmsrc=c_0jbfkpurhe9bmfjp8rmlqja9k8%40group.calendar.google.com|here> at *12:00pm*\n:yoga2:*Wellness - Yoga*: Held in the Xero gym with <https://www.awhiyoga.co.nz/|AWHI Yoga> from *12:00pm-1:00pm*, confirm your spot <https://docs.google.com/spreadsheets/d/1EtVKnMDTf53TkjXPaAxgCN7AvNWlDz9NQNGMg2Ll56o/edit?usp=sharing|here> \n:xero-boxing: *Boxing*: Xero led Boxing Sessions at 5pm in the XO Gym!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*What else?*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":maori-flag: *Ake Ake Ake - A Forever Language*: Check out the Māori Pasifika ERG post in #nz to see what else is on celebrating Te Wiki o te Reo Māori at Xero! \n\n:footprint: *Steptember*: Fuel up with our Boost Breakfast for the afternoon walk, followed by an educational video hosted in the *All Hands* to raise awareness for Cerebral Palsy \n\n:slot_machine: *Xero Game Show Social+*: This months Social+ is on *Thursday 26th September* from 4pm-6pm in the All Hands space"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y180Y2UwNGEwNjY2YjI5NDNlZmEwZGM4YWI5MTdjMTcyNDE2NzVhZmQ5MTllN2EwZjg5NTg5OTVkMTA2MDAzZmEwQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Wellington Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
selector .e-loop-item:nth-of-type(3){
      grid-row: span 2;
}

.e-loop-item:nth-of-type(4){
    grid-column: span 2;
   
}
const audioContext = new (window.AudioContext || window.webkitAudioContext)();

function playSound() {
  const oscillator = audioContext.createOscillator();
  oscillator.type = 'sine';
  oscillator.frequency.setValueAtTime(440, audioContext.currentTime); // Frequency in Hz
  oscillator.connect(audioContext.destination);
  oscillator.start();
  oscillator.stop(audioContext.currentTime + 0.1); // Play sound for 0.1 seconds
}

// Call playSound() at appropriate times during sorting
body {
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: #2F4F4F; /* Dark Slate Gray */
  margin: 0;
  font-family: 'Nunito', sans-serif;
}

h1 {
  font-family: 'Nunito', sans-serif;
  color: #9932cc; /* Dark orchid */
}

#container {
  height: 200px;
  display: flex;
  align-items: flex-end;
}

.bar {
  width: 25px;
  margin: 1px;
  border-radius: 12px; /* Curved edges */
  background: linear-gradient(180deg, #FF6F61, #FFB347); /* Sunset gradient */
}

#button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

#control-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 20px; /* Adjust if needed */
}

button {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #9932cc; /* Dark orchid */
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #ba55d3; /* Orchid */
}

.control-button {
  background-color: #FF6347; /* Tomato color */
}

.control-button:hover {
  background-color: #FF7F50; /* Coral color */
}
const n = 20;
const array = [];
let audioCtx = null;
let animationTimeout = null; // to hold the timeout ID for animation

function playNote(freq) {
  if (audioCtx === null) {
    audioCtx = new (AudioContext || webkitAudioContext || window.webkitAudioContext)();
  }

  const dur = 0.1;
  const osc = audioCtx.createOscillator();
  osc.frequency.value = freq;
  osc.start();
  osc.stop(audioCtx.currentTime + dur);

  const node = audioCtx.createGain();
  node.gain.value = 0.1;
  node.gain.linearRampToValueAtTime(0, audioCtx.currentTime + dur);
  osc.connect(node);
  node.connect(audioCtx.destination);
}

function init() {
  for (let i = 0; i < n; i++) {
    array[i] = Math.random();
  }
  showBars();
}

function showBars(move) {
  const container = document.getElementById('container');
  container.innerHTML = '';
  for (let i = 0; i < array.length; i++) {
    const bar = document.createElement('div');
    bar.style.height = array[i] * 100 + '%';
    bar.classList.add('bar');

    if (move && move.indices.includes(i)) {
      bar.style.backgroundColor = move.type === 'swap' ? '#BA55D0' : '#CBC3E3';
    }

    container.appendChild(bar);
  }
}

function createSortingButton(sortName, sortFunction) {
  const button = document.createElement('button');
  button.textContent = sortName;
  button.classList.add('sort-button');
  button.addEventListener('click', () => {
    array.length = 0;
    init();
    const copy = [...array];
    const moves = sortFunction(copy);
    animate(moves);
  });
  return button;
}

function animate(moves) {
  if (moves.length === 0) {
    showBars();
    return;
  }

  const move = moves.shift();
  const [i, j] = move.indices;

  if (move.type === 'swap') {
    [array[i], array[j]] = [array[j], array[i]];
    playNote(300 + array[i] * 500);
    playNote(300 + array[j] * 500);
  } else if (move.type === 'comp') {
    playNote(200 + array[i] * 200);
    playNote(200 + array[j] * 200);
  }

  showBars(move);
  animationTimeout = setTimeout(() => animate(moves), 200);
}

function bubbleSort(array) {
  const moves = [];
  do {
    var swapped = false;
    for (let i = 1; i < array.length; i++) {
      moves.push({ indices: [i - 1, i], type: 'comp' });
      if (array[i - 1] > array[i]) {
        swapped = true;
        moves.push({ indices: [i - 1, i], type: 'swap' });
        [array[i - 1], array[i]] = [array[i], array[i - 1]];
      }
    }
  } while (swapped);
  return moves;
}

function selectionSort(array) {
  const moves = [];
  for (let i = 0; i < array.length - 1; i++) {
    let minIndex = i;
    for (let j = i + 1; j < array.length; j++) {
      moves.push({ indices: [minIndex, j], type: 'comp' });
      if (array[j] < array[minIndex]) {
        minIndex = j;
      }
    }
    if (minIndex !== i) {
      moves.push({ indices: [i, minIndex], type: 'swap' });
      [array[i], array[minIndex]] = [array[minIndex], array[i]];
    }
  }
  return moves;
}

function insertionSort(array) {
  const moves = [];
  for (let i = 1; i < array.length; i++) {
    let key = array[i];
    let j = i - 1;
    while (j >= 0 && array[j] > key) {
      moves.push({ indices: [j, j + 1], type: 'comp' });
      array[j + 1] = array[j];
      j--;
    }
    moves.push({ indices: [j + 1, j + 1], type: 'swap' });
    array[j + 1] = key;
  }
  return moves;
}

function merge(left, right, moves) {
  let result = [];
  let i = 0, j = 0;

  while (i < left.length && j < right.length) {
    moves.push({ indices: [left[i], right[j]], type: 'comp' });
    if (left[i] <= right[j]) {
      result.push(left[i]);
      i++;
    } else {
      result.push(right[j]);
      j++;
    }
  }

  return result.concat(left.slice(i)).concat(right.slice(j));
}

function mergeSort(array) {
  const moves = [];

  const mergeSortHelper = (array) => {
    if (array.length <= 1) {
      return array;
    }

    const middle = Math.floor(array.length / 2);
    const left = array.slice(0, middle);
    const right = array.slice(middle);

    return merge(mergeSortHelper(left), mergeSortHelper(right), moves);
  };

  mergeSortHelper(array);
  return moves;
}

function partition(array, low, high, moves) {
  const pivot = array[high];
  let i = low - 1;

  for (let j = low; j < high; j++) {
    moves.push({ indices: [array[j], pivot], type: 'comp' });
    if (array[j] < pivot) {
      i++;
      moves.push({ indices: [array[i], array[j]], type: 'swap' });
      [array[i], array[j]] = [array[j], array[i]];
    }
  }

  moves.push({ indices: [array[i + 1], pivot], type: 'swap' });
  [array[i + 1], array[high]] = [array[high], array[i + 1]];
  return i + 1;
}

function quickSort(array) {
  const moves = [];

  const quickSortHelper = (array, low, high) => {
    if (low < high) {
      const pi = partition(array, low, high, moves);

      quickSortHelper(array, low, pi - 1);
      quickSortHelper(array, pi + 1, high);
    }
  };

  quickSortHelper(array, 0, array.length - 1);
  return moves;
}

// Stop animation function
function stopAnimation() {
  clearTimeout(animationTimeout); // Stop the current animation timeout
}

// Reset animation function
function resetAnimation() {
  stopAnimation(); // Stop the current animation
  init(); // Re-initialize the array and display bars
}

// Add more sorting algorithms as needed

const buttonContainer = document.getElementById('button-container');

// Create and append Stop and Reset buttons
const stopButton = document.createElement('button');
stopButton.textContent = 'Stop';
stopButton.classList.add('control-button');
stopButton.addEventListener('click', stopAnimation);

const resetButton = document.createElement('button');
resetButton.textContent = 'Reset';
resetButton.classList.add('control-button');
resetButton.addEventListener('click', resetAnimation);

buttonContainer.appendChild(stopButton);
buttonContainer.appendChild(resetButton);

// Add a line break to separate control buttons from sorting buttons
const lineBreak = document.createElement('br');
buttonContainer.appendChild(lineBreak);

// Append sorting buttons
buttonContainer.appendChild(createSortingButton('Bubble Sort', bubbleSort));
buttonContainer.appendChild(createSortingButton('Selection Sort', selectionSort));
buttonContainer.appendChild(createSortingButton('Insertion Sort', insertionSort));
buttonContainer.appendChild(createSortingButton('Merge Sort', mergeSort));
buttonContainer.appendChild(createSortingButton('Quick Sort', quickSort));

init();
const n = 20;
const array = [];
let audioCtx = null;
let animationTimeout = null; // to hold the timeout ID for animation

function playNote(freq) {
  if (audioCtx === null) {
    audioCtx = new (AudioContext || webkitAudioContext || window.webkitAudioContext)();
  }

  const dur = 0.1;
  const osc = audioCtx.createOscillator();
  osc.frequency.value = freq;
  osc.start();
  osc.stop(audioCtx.currentTime + dur);

  const node = audioCtx.createGain();
  node.gain.value = 0.1;
  node.gain.linearRampToValueAtTime(0, audioCtx.currentTime + dur);
  osc.connect(node);
  node.connect(audioCtx.destination);
}

function init() {
  for (let i = 0; i < n; i++) {
    array[i] = Math.random();
  }
  showBars();
}

function showBars(move) {
  const container = document.getElementById('container');
  container.innerHTML = '';
  for (let i = 0; i < array.length; i++) {
    const bar = document.createElement('div');
    bar.style.height = array[i] * 100 + '%';
    bar.classList.add('bar');

    if (move && move.indices.includes(i)) {
      bar.style.backgroundColor = move.type === 'swap' ? '#BA55D0' : '#CBC3E3';
    }

    container.appendChild(bar);
  }
}

function createSortingButton(sortName, sortFunction) {
  const button = document.createElement('button');
  button.textContent = sortName;
  button.classList.add('sort-button');
  button.addEventListener('click', () => {
    array.length = 0;
    init();
    const copy = [...array];
    const moves = sortFunction(copy);
    animate(moves);
  });
  return button;
}

function animate(moves) {
  if (moves.length === 0) {
    showBars();
    return;
  }

  const move = moves.shift();
  const [i, j] = move.indices;

  if (move.type === 'swap') {
    [array[i], array[j]] = [array[j], array[i]];
    playNote(300 + array[i] * 500);
    playNote(300 + array[j] * 500);
  } else if (move.type === 'comp') {
    playNote(200 + array[i] * 200);
    playNote(200 + array[j] * 200);
  }

  showBars(move);
  animationTimeout = setTimeout(() => animate(moves), 200);
}

function bubbleSort(array) {
  const moves = [];
  do {
    var swapped = false;
    for (let i = 1; i < array.length; i++) {
      moves.push({ indices: [i - 1, i], type: 'comp' });
      if (array[i - 1] > array[i]) {
        swapped = true;
        moves.push({ indices: [i - 1, i], type: 'swap' });
        [array[i - 1], array[i]] = [array[i], array[i - 1]];
      }
    }
  } while (swapped);
  return moves;
}

function selectionSort(array) {
  const moves = [];
  for (let i = 0; i < array.length - 1; i++) {
    let minIndex = i;
    for (let j = i + 1; j < array.length; j++) {
      moves.push({ indices: [minIndex, j], type: 'comp' });
      if (array[j] < array[minIndex]) {
        minIndex = j;
      }
    }
    if (minIndex !== i) {
      moves.push({ indices: [i, minIndex], type: 'swap' });
      [array[i], array[minIndex]] = [array[minIndex], array[i]];
    }
  }
  return moves;
}

function insertionSort(array) {
  const moves = [];
  for (let i = 1; i < array.length; i++) {
    let key = array[i];
    let j = i - 1;
    while (j >= 0 && array[j] > key) {
      moves.push({ indices: [j, j + 1], type: 'comp' });
      array[j + 1] = array[j];
      j--;
    }
    moves.push({ indices: [j + 1, j + 1], type: 'swap' });
    array[j + 1] = key;
  }
  return moves;
}

function merge(left, right, moves) {
  let result = [];
  let i = 0, j = 0;

  while (i < left.length && j < right.length) {
    moves.push({ indices: [left[i], right[j]], type: 'comp' });
    if (left[i] <= right[j]) {
      result.push(left[i]);
      i++;
    } else {
      result.push(right[j]);
      j++;
    }
  }

  return result.concat(left.slice(i)).concat(right.slice(j));
}

function mergeSort(array) {
  const moves = [];

  const mergeSortHelper = (array) => {
    if (array.length <= 1) {
      return array;
    }

    const middle = Math.floor(array.length / 2);
    const left = array.slice(0, middle);
    const right = array.slice(middle);

    return merge(mergeSortHelper(left), mergeSortHelper(right), moves);
  };

  mergeSortHelper(array);
  return moves;
}

function partition(array, low, high, moves) {
  const pivot = array[high];
  let i = low - 1;

  for (let j = low; j < high; j++) {
    moves.push({ indices: [array[j], pivot], type: 'comp' });
    if (array[j] < pivot) {
      i++;
      moves.push({ indices: [array[i], array[j]], type: 'swap' });
      [array[i], array[j]] = [array[j], array[i]];
    }
  }

  moves.push({ indices: [array[i + 1], pivot], type: 'swap' });
  [array[i + 1], array[high]] = [array[high], array[i + 1]];
  return i + 1;
}

function quickSort(array) {
  const moves = [];

  const quickSortHelper = (array, low, high) => {
    if (low < high) {
      const pi = partition(array, low, high, moves);

      quickSortHelper(array, low, pi - 1);
      quickSortHelper(array, pi + 1, high);
    }
  };

  quickSortHelper(array, 0, array.length - 1);
  return moves;
}

// Stop animation function
function stopAnimation() {
  clearTimeout(animationTimeout); // Stop the current animation timeout
}

// Reset animation function
function resetAnimation() {
  stopAnimation(); // Stop the current animation
  init(); // Re-initialize the array and display bars
}

// Add more sorting algorithms as needed

const buttonContainer = document.getElementById('button-container');

// Create and append Stop and Reset buttons
const stopButton = document.createElement('button');
stopButton.textContent = 'Stop';
stopButton.classList.add('control-button');
stopButton.addEventListener('click', stopAnimation);

const resetButton = document.createElement('button');
resetButton.textContent = 'Reset';
resetButton.classList.add('control-button');
resetButton.addEventListener('click', resetAnimation);

buttonContainer.appendChild(stopButton);
buttonContainer.appendChild(resetButton);

// Add a line break to separate control buttons from sorting buttons
const lineBreak = document.createElement('br');
buttonContainer.appendChild(lineBreak);

// Append sorting buttons
buttonContainer.appendChild(createSortingButton('Bubble Sort', bubbleSort));
buttonContainer.appendChild(createSortingButton('Selection Sort', selectionSort));
buttonContainer.appendChild(createSortingButton('Insertion Sort', insertionSort));
buttonContainer.appendChild(createSortingButton('Merge Sort', mergeSort));
buttonContainer.appendChild(createSortingButton('Quick Sort', quickSort));

init();
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sorting Visualizer</title>
  <link href="https://fonts.googleapis.com/css2?family=Nunito:wght@700&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <h1>🎶 Sorting Visualizer 🎶</h1>
  <div id="container"></div>

  <hr>

  <div id="button-container">
    <div id="control-buttons">
      <button class="control-button">Stop</button>
      <button class="control-button">Reset</button>
    </div>
    <button>Button 1</button>
    <button>Button 2</button>
    <button>Button 3</button>
    <button>Button 4</button>
  </div>

  <script src="script.js"></script>
</body>
</html>
selector > div {
    padding: 20px;
    border: 1px solid white;
    margin: 0;
}

selector {
    padding: 10px!important;
    background-color: #3b5346;
    display: flex;
    flex-direction: column;
    align-items: normal;
    justify-content: stretch;
    border-radius: 2em 2em 2em 2em;
    margin-top: 20px;
}
selector:hover {
	background-color: #0c0d0e;
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":newspaper:  STAY IN THE KNOW  :newspaper:"
			}
		},
		{
			"type": "context",
			"elements": [
				{
					"text": "*August 1, 2024*  |  Office Announcements",
					"type": "mrkdwn"
				}
			]
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay in the loop about what's happening at the office such as upcoming visitors, onsite meetings, lunches, and more. Don't miss out- check out the <https://calendar.google.com/calendar/u/0?cid=Y19jNmI2NzM1OTU0NDA0NzE1NWE3N2ExNmE5NjBlOWZkNTgxN2Y1MmQ3NjgyYmRmZmVlMjU4MmQwZDgyMGRiNzMyQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20|*Tor Happenings Calendar*>"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":calendar: | :breakfast: *TUESDAY BREAKFAST SCHEDULE* :breakfast: | :calendar: "
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/6` *Greenbox*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/13` *Impact Kitchen*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/20` *Egg Club*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/27` *Neon Commissary*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":calendar: |:lunch: *THURSDAY LUNCH SCHEDULE* :lunch: | :calendar: "
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/1` *Chiang Mai* _Thai_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/8` *Pie Commission*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/15` *Impact Kitchen* _Salad Bowls_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/22` *Scotty Bons* _Caribbean_"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "`8/29` *Black Camel* _Sandwiches_"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":loud_sound:*FOR YOUR INFORMATION* :loud_sound:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Every Tuesday and Thursday*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at *245 Queen St W*, by showing your *Xero ID* \n\n:holiday-potato: *Upcoming Public Holiday*: Monday, 5th August \n\n:OFFICE: *Self-Serviced Fridays* _WX will still be online and working, just not onsite_. For more information, check out our <https://docs.google.com/document/d/1yPfsoOt4o-_scOmAGtYuZduzW_8333id2w5dhrlnVz0/edit| *FAQ page*> or reach out to WX. \n\n :standup: *Canada Stand Up* \n *August 15th*- Hosted by Intern Engineer, *Daniel Iseoluwa* \n\n:blob-party: *Monthly Social* \n*August 29th @ 3:30pm*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":WX: *WX offers comprehensive event planning services, including:*\n - Assistance with logistics and coordination \n - Access to a network of vendors for catering, supply ordering, etc.\n\n _Note: Even if you don’t need our assistance but are using the office space, kindly inform WX._ "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":tada: *Happy Birthday* :tada: to all Xeros celebrating their birthdays this August! We hope you have an amazing day :party_wiggle: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "context",
			"elements": [
				{
					"type": "mrkdwn",
					"text": ":pushpin: Have something important to add to our calendar or need some assistance? Get in touch with us by logging a ticket via the <https://xerohelp.zendesk.com/hc/en-us/requests/new?ticket_form_id=900001672246| *HelpCentre*>. We are here to help!"
				}
			]
		},
		{
			"type": "divider"
		}
	]
}
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySvc. In the value "start", change the data value from "3" to "4".
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Leaf Classifier</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <div class="container">
        <h1>Leaf Classifier</h1>
        <input type="file" id="leafImage" accept="image/*">
        <button id="classifyButton">Classify Leaf</button>
        <div id="resultContainer"></div>
    </div>
    <script src="script.js"></script>
</body>
</html>
add_action('wp_head', 'skip_link_fix');
function skip_link_fix() {
	?>
  <script>
  window.addEventListener( 'elementor/frontend/init', function() {
  if ( typeof elementorFrontend === 'undefined' ) {
  return;
  }
 
  elementorFrontend.on( 'components:init', function() {
  elementorFrontend.utils.anchors.setSettings('selectors',{});
  } );
  } );
  </script>
<?php
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Boost Day is Here! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Toronto! \n\nIt's Boost Day!\n\nCheck out today's fantastic lineup: "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at 245 Queen St W, by showing your *Xero ID*.\n:breakfast: *Breakfast*: Provided by *Pico de Gallo* at *9AM - 10AM* in the Kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "plain_text",
				"text": "Have an amazing Boost Day, Toronto!\n\nLove,\n\nWX  :party-wx:  ",
				"emoji": true
			}
		}
	]
}
public static class JSONSerializer<TType> where TType : class
{
    /// <summary>
    /// Serializes an object to JSON
    /// </summary>
    public static string Serialize(TType instance)
    {
        var serializer = new DataContractJsonSerializer(typeof(TType));
        using (var stream = new MemoryStream())
        {
            serializer.WriteObject(stream, instance);
            return Encoding.Default.GetString(stream.ToArray());
        }
    }

    /// <summary>
    /// DeSerializes an object from JSON
    /// </summary>
    public static TType DeSerialize(string json)
    {
        using (var stream = new MemoryStream(Encoding.Default.GetBytes(json)))
        {
            var serializer = new DataContractJsonSerializer(typeof(TType));
            return serializer.ReadObject(stream) as TType;
        }
    }
}
function generate_gallery_tab_navigation($atts)
{
    $args = array(
        'taxonomy' => 'gallery_category',
        'hide_empty' => -1,
        'orderby' => 'name',
        'order' => 'ASC'
    );

    $categories = get_categories($args);

    ob_start(); ?>

    <div class="gallery-tabs-wrapper">
        <ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
            <?php if (!empty($categories)) : ?>
                <?php $nav_counter = 1; ?>
                <?php foreach ($categories as $category) : ?>
                    <li class="nav-item" role="presentation">
                        <button class="nav-link <?php echo ($nav_counter === 1) ? 'active' : ''; ?>" id="pills-<?php echo $category->slug; ?>-tab" data-bs-toggle="pill" data-bs-target="#pills-<?php echo $category->slug; ?>" type="button" role="tab" aria-controls="pills-<?php echo $category->slug; ?>" aria-selected="<?php echo ($nav_counter === 1) ? 'true' : 'false'; ?>">
                            <?php echo $category->name; ?>
                        </button>
                    </li>
                    <?php $nav_counter++; ?>
                <?php endforeach; ?>
            <?php endif; ?>
        </ul>
    </div>

<?php
    return ob_get_clean();
}
add_shortcode('gallery_tab_navigation', 'generate_gallery_tab_navigation');

function generate_gallery_tab_content($atts)
{
    $args = array(
        'post_type' => 'gallery',
        'posts_per_page' => -1,
        'order' => 'ASC',
    );

    $gallery_posts = new WP_Query($args);

    ob_start(); ?>

    <div class="tab-content" id="pills-tabContent">
        <?php if ($gallery_posts->have_posts()) : ?>
            <?php
            $active_set = false;
            while ($gallery_posts->have_posts()) :
                $gallery_posts->the_post();
                $categories = get_the_terms(get_the_ID(), 'gallery_category');
                if ($categories) : ?>
                    <?php foreach ($categories as $category) : ?>
                        <div class="tab-pane fade <?php echo (!$active_set) ? 'show active' : ''; ?>" id="pills-<?php echo $category->slug; ?>" role="tabpanel" aria-labelledby="pills-<?php echo $category->slug; ?>-tab">
                            <div class="gallerys">
                                <div class="row">
                                    <?php
                                    $category_posts_args = array(
                                        'post_type' => 'gallery',
                                        'posts_per_page' => -1,
                                        'tax_query' => array(
                                            array(
                                                'taxonomy' => 'gallery_category',
                                                'field' => 'term_id',
                                                'terms' => $category->term_id,
                                            ),
                                        ),
                                    );
                                    $category_posts = new WP_Query($category_posts_args);
                                    if ($category_posts->have_posts()) : ?>
                                        <?php while ($category_posts->have_posts()) :
                                            $category_posts->the_post(); ?>
                                            <div class="col-md-4 gall-img">
                                                <div class="gallery_inner">
                                                    <a class="fancybox" data-fancybox="gallery" href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>">
                                                        <?php the_post_thumbnail(); ?>
                                                    </a>
                                                </div>
                                            </div>
                                        <?php endwhile; ?>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                        <?php
                        $active_set = true;
                        ?>
                    <?php endforeach; ?>
                <?php endif; ?>
            <?php endwhile; ?>
        <?php endif; ?>
    </div>

<?php
    wp_reset_postdata();
    return ob_get_clean();
}
add_shortcode('gallery_tab_content', 'generate_gallery_tab_content');
package com.lgcns.esg.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.lgcns.esg.core.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;
import java.util.List;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "D_SYSTEM_TYPE")
public class SystemType extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SYS_TYPE_ID")
    private Long id;
    @Column(name = "CODE",unique = true)
    private String code;
    @Column(name = "NAME")
    private String name;

    @Column(name = "DELETED_AT")
    private LocalDateTime deletedAt;

    @Column(name = "DELETED_BY")
    private String deletedBy;
    @Column(name = "IS_DELETED")
    private boolean deleted;
    @OneToMany(mappedBy = "systemType", cascade = CascadeType.ALL)
    @JsonBackReference
    private List<SystemParams> systemParams;
}
package com.lgcns.esg.entity;

import com.lgcns.esg.core.entity.BaseEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.LocalDateTime;

@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "D_SYSTEM_PARAMS")
public class SystemParams extends BaseEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SYS_PARAMS_ID")
    private Long id;
    @Column(unique = true, name="CODE")
    private String code;
    @Column(name = "VALUE")
    private String value;

    @Column(name = "DELETED_AT")
    private LocalDateTime deletedAt;

    @Column(name = "DELETED_BY")
    private String deletedBy;
    @Column(name = "IS_DELETED")
    private boolean deleted;
    @ManyToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "SYS_TYPE_ID" )
    private SystemType systemType;

}
javascript: (function () {
  let host = location.host;
  if (host.includes("youtube.com")) {
    const emb = document
      .querySelector("link[itemprop='embedUrl']")
      .getAttribute("href");
    window.location.assign(emb);
  } else {
    window.alert("⚠️not YouTube");
  }
})();
> powershell -command "Get-ChildItem -Path C:\ -Recurse | Sort-Object Length -Descending | Select-Object FullName, Length -First 20 | Format-Table -AutoSize";
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: Introducing Xero Boost Days! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Hey Toronto! \n\nWe're excited to announce the launch of our Boost Day Program!\n\nStarting this week, as part of our <https://xpresso.xero.com/blog/featured/more-opportunities-to-come-together-with-xeros-connect/|*Xeros Connect Strategy*>, you'll experience supercharged days at the office every *Tuesday* and *Thursday*. Get ready for a blend of delicious food, beverages, wellness activites, and fun connections!\n\nPlease see below for what's on this week! "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Tuesday, 30th July",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy coffee and café-style beverages from our partner, *HotBlack Coffee*, located at 245 Queen St W, by showing your *Xero ID*.\n:breakfast: *Breakfast*: Provided by *Pico de Gallo* at *9AM* in the Kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-1: Thursday, 1st August",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy coffee and café-style beverages from *HotBlack* by showing your *Xero ID*.\n:lunch: *Lunch*: Provided by *Chiang Mai* at *12:00PM* in the Kitchen.\n"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 15th August*\n :standup: *Stand Up* hosted by Intern Engineer, *Daniel Iseoluwa*  \n *Thursday, 29th August*\n:blob-party: *Social +*: Drinks, food, and engaging activities bringing everyone together. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/embed?src=c_c6b67359544047155a77a16a960e9fd5817f52d7682bdffee2582d0d820db732%40group.calendar.google.com&ctz=America%2FToronto|*Tor Happenings Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
Процедура ПриНачалеРаботыСистемы ()
	УстановитьКраткийЗаголовокПриложения ("Денис Кондрашов");
	
	МойВозраст = 25; 
	
	ЯИдуВДетскийСад = Ложь;
	ЯИдуВШколу = Ложь;
	ЯИдуНаРаботу = Ложь;  
	
	Если МойВозраст < 7 Тогда
		ЯИдуВДетскийСад = Истина;
		
	ИначеЕсли МойВозраст >= 7 И МойВозраст < 19 Тогда
		ЯИдуВШколу = Истина;
		
	Иначе ЯИдуНаРаботу = Истина;
		КонецЕсли;
				
КонецПроцедуры
Процедура ПриНачалеРаботыСистемы ()
	УстановитьКраткийЗаголовокПриложения ("Денис Кондрашов");
	
	МойВозраст = 20;
	Если МойВозраст < 7 Тогда
		ЯИдуВДетскийСад = Истина;
		ЯИдуВШколу = Ложь;
		
	ИначеЕсли МойВозраст >= 7 И МойВозраст < 19 Тогда
		ЯИдуВДетскийСад = Ложь;
		ЯИдуВШколу = Истина;
		
	Иначе ЯИдуНаРаботу = Истина;
		КонецЕсли;
				
КонецПроцедуры
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":brewbuddy: Boost Day: Brew Buddy Launch :brewbuddy:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "As a part of our exciting Boost Day program, the new elevated Cafe Experience will feature a new friend :people_hugging:\n \nJoin us in celebrating the launch of our favourite barista friend, *Brew Buddy*. To enhance and elevate your café experience, we're introducing a brand new tool for ordering your coffees, replacing the Asana board. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":info_: Here's a few things to know:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:dot-blue:Brew Buddy is an enhanced barista service software created by an awesome group of grads as a part of Hackathon.\n\n:dot-blue:Our favourite feature is the Slack notification you get once your coffee is ready to go!\n\n:dot-blue:BIt is a more efficient way to order your coffee that minimises time away from work and creates a more seamless experience for Xero's and our baristas."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Keep an eye out for the *'Weekly Special'* option in the ordering form to keep up with the latest caffeine trends and try something new!\n\n*Love*,\n*WX Team* :party-wx:"
			}
		}
	]
}
 <script>
    jQuery(document).ready(function($){
        if (window.location.href == "https://dinglecrystal.ie/pages/factory-demonstrations" || window.location.href == "https://dinglecrystal.ie/products/factory-tour-30min") {
            $('body').append('<a href="https://fareharbor.com/embeds/book/dinglecrystal/?full-items=yes" style="font-family:\'Twentieth Century\', sans-serif !important; border:2px solid #FFFFFF !important; font-weight:bold !important; letter-spacing: 4.2px !important; box-shadow:none !important; padding: .2em 2em !important;" class="fh-hide--mobile fh-fixed--side fh-icon--cal fh-button-true-flat-color">BOOK TOUR</a><a href="https://fareharbor.com/embeds/book/dinglecrystal/?full-items=yes" style="font-family:\'Twentieth Century\', sans-serif !important; font-size: 1.1em !important; border:2px solid #FFFFFF !important; font-weight:bold !important; letter-spacing: 4.2px !important; box-shadow:none !important; padding: .2em 3em !important;" class="fh-hide--desktop fh-size--small fh-fixed--side fh-button-true-flat-color fh-color--white">BOOK TOUR</a>');
        }
    });
    </script>
# CICD using GitHub actions

name: CI/CD

# Exclude the workflow to run on changes to the helm chart
on:
  push:
    branches:
      - main
    paths-ignore:
      - 'helm/**'
      - 'k8s/**'
      - 'README.md'

jobs:

  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Go 1.22
      uses: actions/setup-go@v2
      with:
        go-version: 1.22

    - name: Build
      run: go build -o go-web-app

    - name: Test
      run: go test ./...
  
  code-quality:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Run golangci-lint
      uses: golangci/golangci-lint-action@v6
      with:
        version: v1.56.2
  
  push:
    runs-on: ubuntu-latest

    needs: build

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v1

    - name: Login to DockerHub
      uses: docker/login-action@v3
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}

    - name: Build and Push action
      uses: docker/build-push-action@v6
      with:
        context: .
        file: ./Dockerfile
        push: true
        tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-web-app:${{github.run_id}}

  update-newtag-in-helm-chart:
    runs-on: ubuntu-latest

    needs: push

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
      with:
        token: ${{ secrets.TOKEN }}

    - name: Update tag in Helm chart
      run: |
        sed -i 's/tag: .*/tag: "${{github.run_id}}"/' helm/go-web-app-chart/values.yaml

    - name: Commit and push changes
      run: |
        git config --global user.email "vivekstyne5@gmail.com"
        git config --global user.name "Vivek-kumar-official"
        git add helm/go-web-app-chart/values.yaml
        git commit -m "Update tag in Helm chart"
        git push
package com.lgcns.esg.repository.system.Custom;
import com.lgcns.esg.model.response.system.PageResult;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections;
import com.querydsl.core.types.dsl.PathBuilderFactory;
import com.querydsl.jpa.impl.JPAQuery;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import com.lgcns.esg.model.request.system.SearchSystemTypeRequest;
import com.lgcns.esg.model.response.system.SystemTypeResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.support.Querydsl;
import org.springframework.stereotype.Repository;

import java.util.List;


import static com.lgcns.esg.core.util.QueryBuilder.LIKE;
import static com.lgcns.esg.core.util.QueryBuilder.buildSearchPredicate;

@Repository
    @RequiredArgsConstructor
    public class SystemTypeRepositoryCustom {
        @PersistenceContext
        private final EntityManager entityManager;

        private static final QSystemType qSystemType = QSystemType.systemType;


        public PageResult<SystemTypeResponse> searchSystemType(SearchSystemTypeRequest request, Pageable pageable) {
            Querydsl querydsl = new Querydsl(entityManager, (new PathBuilderFactory().create(SystemTypeResponse.class)));
            JPAQuery<SystemTypeResponse> query = new JPAQuery<>(entityManager);
            BooleanBuilder conditions = new BooleanBuilder();
            query.select(Projections.bean(SystemTypeResponse.class, qSystemType.id, qSystemType.code, qSystemType.name)).from(qSystemType);
            conditions.and(qSystemType.isDeleted.eq(false));
            buildSearchPredicate(conditions, LIKE, qSystemType.code, request.getSystemTypeCode());
            buildSearchPredicate(conditions, LIKE, qSystemType.name, request.getSystemTypeName());
            query.where(conditions).orderBy(qSystemType.createAt.desc()).distinct();
            List<SystemTypeResponse> responses = querydsl.applyPagination(pageable, query).fetch();
            int count = (int)query.fetchCount();
            return new PageResult<>(count, responses);
        }
    }
}
package com.lgcns.esg.core.util;

import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Ops;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.ComparableExpressionBase;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.StringExpression;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Objects;

public class QueryBuilder {
    private QueryBuilder() {
    }

    public static final String EQUAL = "=";
    public static final String NOT_EQUAL = "!=";
    public static final String LIKE = "%";
    public static final String GREATER_THAN = ">";
    public static final String LESS_THAN = "<";
    public static final String GREATER_THAN_OR_EQUAL = ">=";

    public static final String LESS_THAN_OR_EQUAL = "=<";
    public static final String IN = "IN";
    public static final String NOT_IN = "NOT_IN";

    public static <T extends Comparable<?>> void buildSearchPredicate(BooleanBuilder condition, String operation, ComparableExpressionBase<T> field, T searchData) {
        if (Objects.nonNull(searchData)) {
            BooleanExpression expression = null;
            switch (operation) {
                case EQUAL -> expression = field.eq(searchData);
                case NOT_EQUAL -> expression = field.ne(searchData);
                case LIKE -> {
                    if (field instanceof StringExpression stringExpression) {
                        expression = stringExpression.containsIgnoreCase(searchData.toString());
                    } else {
                        throw new IllegalArgumentException("Field does not support 'like' operation");
                    }
                }
                case GREATER_THAN ->
                        expression = Expressions.booleanOperation(Ops.GT, field, Expressions.constant(searchData));
                case LESS_THAN ->
                        expression = Expressions.booleanOperation(Ops.LT, field, Expressions.constant(searchData));
                case GREATER_THAN_OR_EQUAL ->
                        expression = Expressions.booleanOperation(Ops.GOE, field, Expressions.constant(searchData));
                case LESS_THAN_OR_EQUAL ->
                        expression = Expressions.booleanOperation(Ops.LOE, field, Expressions.constant(searchData));
                default -> throw new IllegalArgumentException("Not support operator:" + operation);
            }
            if (expression != null) {
                condition.and(expression);
            }
        }
    }

    public static <T extends Comparable<?>> void buildSearchPredicate(BooleanBuilder condition, String operation, ComparableExpressionBase<T> field, List<T> searchData) {
        if (Objects.nonNull(searchData) && !CollectionUtils.isEmpty(searchData)) {
            switch (operation) {
                case IN -> condition.and(field.in(searchData));
                case NOT_IN -> condition.and(field.notIn(searchData));
                default -> throw new IllegalArgumentException("Not support operator:" + operation);
            }
        }
    }
}

Ready to elevate your business to the next level? Build your own blockchain ecosystem with CoinsQueens! This custom digital ledger system is designed just for you, giving you full control over operations, governance, and features. Enjoy enhanced security, faster processes, and tailor-made solutions to fit your specific needs.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: go-web-app
  labels:
    app: go-web-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: go-web-app
  template:
    metadata:
      labels:
        app: go-web-app
    spec:
      containers:
      - name: go-web-app
        image: vivekstyne/go-web-app:v1
        ports:
        - containerPort: 8080
// Select the parent element
const parent = document.getElementById('parentElementId');

// While the parent has child nodes, remove the first one
while (parent.firstChild) {
    parent.removeChild(parent.firstChild);
}
Date: 29-7-2024              Section: III-I CSE-E
Topic: Functions
---------------------------------------------------------------------

1.Write a function named printWelcomeMessage that prints "Welcome to the Online Shopping App!" to the console. 
2.Write a function named printGoodbyeMessage that prints "Thank you for visiting the Online Shopping App!" to the console.
3.Write a function named addProduct that takes a String parameter productName and prints "Product <productName> added to the inventory".
 Note: Call this function with different product names.

4.Write a function named removeProduct that takes a String parameter productName and prints "Product <productName> removed from the inventory.". 
Note: Call this function with different product names. 

5. Write a function named calculateDiscount that takes two Double parameters price and discountRate, and returns the discounted price. Print the returned value in the main function.
6.Write a function named isProductAvailable that takes a String parameter productName and returns true if the product is available in stock, and false otherwise. 
Print the result in the main function.
7. Write a single-expression function named calculateTax that takes a Double parameter price and returns the tax amount (assume a tax rate of 10%). 
Print the result in the main function.
8. Write a single-expression function named calculateTotalPrice that takes two Double parameters price and tax and returns their sum. 
Print the result in the main function.
9. Write a function named createUserAccount that takes a String parameter userName with a default value of "Guest" and prints "User account <userName> created.". 
Note: Call this function with and without passing a user name.
10. Write a function named applyCoupon that takes a Double parameter discount with a default value of 10.0 and prints "Coupon applied with <discount>% discount.". 
Note: Call this function with and without passing a discount.
11. Write a function named updateUserProfile that takes three String parameters firstName, lastName, and email, and prints "User profile updated: <firstName> <lastName>, Email: <email>". 
Call this function using named arguments.
12. Write a function named placeOrder that takes three String parameters productName, deliveryAddress, and paymentMethod, and prints "Order placed for <productName> to be delivered at <deliveryAddress> using <paymentMethod>". 
note: Call this function using named arguments and print the result.



Date: 29-7-2024              Section: III-I CSE-E
Topic: Functions
---------------------------------------------------------------------

1.Write a function named printWelcomeMessage that prints "Welcome to the Online Shopping App!" to the console. 
2.Write a function named printGoodbyeMessage that prints "Thank you for visiting the Online Shopping App!" to the console.
3.Write a function named addProduct that takes a String parameter productName and prints "Product <productName> added to the inventory".
 Note: Call this function with different product names.

4.Write a function named removeProduct that takes a String parameter productName and prints "Product <productName> removed from the inventory.". 
Note: Call this function with different product names. 

5. Write a function named calculateDiscount that takes two Double parameters price and discountRate, and returns the discounted price. Print the returned value in the main function.
6.Write a function named isProductAvailable that takes a String parameter productName and returns true if the product is available in stock, and false otherwise. 
Print the result in the main function.
7. Write a single-expression function named calculateTax that takes a Double parameter price and returns the tax amount (assume a tax rate of 10%). 
Print the result in the main function.
8. Write a single-expression function named calculateTotalPrice that takes two Double parameters price and tax and returns their sum. 
Print the result in the main function.
9. Write a function named createUserAccount that takes a String parameter userName with a default value of "Guest" and prints "User account <userName> created.". 
Note: Call this function with and without passing a user name.
10. Write a function named applyCoupon that takes a Double parameter discount with a default value of 10.0 and prints "Coupon applied with <discount>% discount.". 
Note: Call this function with and without passing a discount.
11. Write a function named updateUserProfile that takes three String parameters firstName, lastName, and email, and prints "User profile updated: <firstName> <lastName>, Email: <email>". 
Call this function using named arguments.
12. Write a function named placeOrder that takes three String parameters productName, deliveryAddress, and paymentMethod, and prints "Order placed for <productName> to be delivered at <deliveryAddress> using <paymentMethod>". 
note: Call this function using named arguments and print the result.



star

Wed Jul 31 2024 09:41:02 GMT+0000 (Coordinated Universal Time) jobs.ts in COOP

@vankoosh #javascript

star

Wed Jul 31 2024 09:34:20 GMT+0000 (Coordinated Universal Time) https://zenn.dev/kiri_i/articles/gitignore_io

@maridann1022 #bash #git

star

Wed Jul 31 2024 09:21:28 GMT+0000 (Coordinated Universal Time) https://qiita.com/urouro_net/items/dd7166f9728d08bc933b

@maridann1022 #react

star

Wed Jul 31 2024 08:02:28 GMT+0000 (Coordinated Universal Time) https://qiita.com/91works-i-kato/items/9f9ad03fee32d42ed547

@maridann1022 #react #type #docker

star

Wed Jul 31 2024 07:51:17 GMT+0000 (Coordinated Universal Time) https://qiita.com/shizuma/items/2b2f873a0034839e47ce

@maridann1022 #ssh #git

star

Wed Jul 31 2024 07:42:46 GMT+0000 (Coordinated Universal Time)

@chiragwebelight

star

Wed Jul 31 2024 07:14:20 GMT+0000 (Coordinated Universal Time)

@radeon323 #js #javascript #typescript #ts

star

Wed Jul 31 2024 04:50:08 GMT+0000 (Coordinated Universal Time)

@WXAPAC

star

Wed Jul 31 2024 04:26:04 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/46626633/how-do-you-insert-html-into-a-quilljs

@webmaster30

star

Wed Jul 31 2024 04:21:30 GMT+0000 (Coordinated Universal Time)

@signup

star

Tue Jul 30 2024 23:55:08 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Tue Jul 30 2024 21:08:02 GMT+0000 (Coordinated Universal Time)

@odesign

star

Tue Jul 30 2024 21:03:28 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 21:01:48 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:59:21 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:59:20 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:54:33 GMT+0000 (Coordinated Universal Time)

@tanushahaha

star

Tue Jul 30 2024 20:34:52 GMT+0000 (Coordinated Universal Time)

@odesign

star

Tue Jul 30 2024 19:55:47 GMT+0000 (Coordinated Universal Time)

@RobertoSilvaZ #mongoshell #sql #mongo

star

Tue Jul 30 2024 19:04:20 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Tue Jul 30 2024 17:52:47 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:51:35 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:50:29 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:49:54 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 17:49:39 GMT+0000 (Coordinated Universal Time) https://reeborg.ca/reeborg.html?lang

@MD_MASUD #undefined

star

Tue Jul 30 2024 16:30:33 GMT+0000 (Coordinated Universal Time) https://techcommunity.microsoft.com/t5/windows-server-for-it-pro/disable-automatic-proxy-setup-automatically-detect-settings/m-p/3896157

@Curable1600 #windows #browsers #youtube

star

Tue Jul 30 2024 15:45:43 GMT+0000 (Coordinated Universal Time)

@signup

star

Tue Jul 30 2024 15:19:54 GMT+0000 (Coordinated Universal Time)

@shm1ckle #php

star

Tue Jul 30 2024 13:08:17 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Tue Jul 30 2024 11:29:12 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/9573119/how-to-parse-json-without-json-net-library

@rick_m #cs

star

Tue Jul 30 2024 11:23:49 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Tue Jul 30 2024 08:41:11 GMT+0000 (Coordinated Universal Time)

@namnt

star

Tue Jul 30 2024 08:40:51 GMT+0000 (Coordinated Universal Time)

@namnt

star

Tue Jul 30 2024 01:20:15 GMT+0000 (Coordinated Universal Time)

@agedofujpn #javascript

star

Tue Jul 30 2024 01:01:41 GMT+0000 (Coordinated Universal Time)

@RobertoSilvaZ #powershell #windows11 #system #performance

star

Mon Jul 29 2024 20:28:20 GMT+0000 (Coordinated Universal Time)

@WXCanada

star

Mon Jul 29 2024 12:10:21 GMT+0000 (Coordinated Universal Time)

@Denixis24

star

Mon Jul 29 2024 12:02:27 GMT+0000 (Coordinated Universal Time)

@Denixis24

star

Mon Jul 29 2024 10:21:15 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Mon Jul 29 2024 09:46:05 GMT+0000 (Coordinated Universal Time)

@Shira

star

Mon Jul 29 2024 09:43:59 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Mon Jul 29 2024 09:41:06 GMT+0000 (Coordinated Universal Time)

@namnt

star

Mon Jul 29 2024 09:40:30 GMT+0000 (Coordinated Universal Time)

@namnt

star

Mon Jul 29 2024 09:33:58 GMT+0000 (Coordinated Universal Time) https://www.coinsqueens.com/blog/create-your-own-blockchain-network

@Kiruthikaa #ownblockchainecosystem #blockchaindevelopment #smartcontractintegration

star

Mon Jul 29 2024 08:36:38 GMT+0000 (Coordinated Universal Time)

@Vivekstyn

star

Mon Jul 29 2024 08:32:29 GMT+0000 (Coordinated Universal Time)

@davidmchale #firstchild #remove

star

Mon Jul 29 2024 08:24:04 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Jul 29 2024 08:22:37 GMT+0000 (Coordinated Universal Time)

@signup

star

Mon Jul 29 2024 07:30:26 GMT+0000 (Coordinated Universal Time) https://dubverse.ai/

@UbedKhan

Save snippets that work with our extensions

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