Skip to content

Instantly share code, notes, and snippets.

View Khant-Nyar's full-sized avatar

Khant Si Thu Phyo Khant-Nyar

View GitHub Profile
@Khant-Nyar
Khant-Nyar / index.html
Created December 19, 2022 16:54
Slot Machine CSS
<div id="app">
<div class="doors">
<div class="door">
<div class="boxes">
<!-- <div class="box">?</div> -->
</div>
</div>
<div class="door">
<div class="boxes">
@Khant-Nyar
Khant-Nyar / index.pug
Created December 19, 2022 16:52
slot machine 🎰
.title
- const slots = ['⚬', 'S', 'L', 'O', 'T', 'S', '⚬']
- for (let sl = 0; sl < slots.length; sl++)
span= slots[sl]
.slots
.combs
- for(let c = 1; c <= 3; c++)
.comb= 'COMB ' + c
.lines
@Khant-Nyar
Khant-Nyar / cheat.js
Last active December 3, 2022 18:04
tips and tracks in javascript
//1. Destructuring with Parameters
buttonElement.addEventListener("click", ({ target }) {
// is the same as using e.target 👇
console.log(target);
});
//Old Code (using if statement - 4 lines)
let username = getUsername();
@Khant-Nyar
Khant-Nyar / print_duplicate_element.c
Last active August 24, 2020 11:40
Q. Program to print the duplicate elements of an array
#include <stdio.h>
int main()
{
//Initialize array
int arr[] = {1, 2, 3, 4, 2, 7, 8, 8, 3};
//Calculate length of array arr
int length = sizeof(arr)/sizeof(arr[0]);
// pagination
echo "<div class='w3-bar w3-center'>";
if ($page > 1) {
echo "<a href='?page=1' class='w3-btn'><<</a>";
$prevpage = $page - 1;
echo "<a href='?page=$prevpage' class='w3-btn'><</a>";
}
$range = 3;
for ($i = ($page - $range); $i < ($page + $range) + 1; $i++) {
if (($i > 0) && ($i <= $totalpages)) {