Skip to content

Instantly share code, notes, and snippets.

View moking55's full-sized avatar
:octocat:
Coolkid never sleep

Maythawat Mahawan moking55

:octocat:
Coolkid never sleep
View GitHub Profile
#!/bin/bash
# กำหนดสีสำหรับข้อความ
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# ตรวจสอบสิทธิ์ Root
if [ "$EUID" -ne 0 ]; then
describe('View Product Listings', () => {
it('should display the product listings on the first page', () => {
cy.visit('https://practicesoftwaretesting.com/')
cy.get('h5.card-title').should('have.length.greaterThan', 0)
})
})
describe('Paginate', () => {
it('should see the product lists', () => {
@moking55
moking55 / Readme.md
Last active March 28, 2024 14:33
Example of basic python code

อธิบายโค้ด

เริ่มต้นด้วยการพิมพ์เมนูไปยังคอนโซลด้วยสองตัวเลือก แล้วรอรับคำสั่งจากผู้ใช้มาเก็บไว้ในตัวแปร menu

ค่าที่รับเข้ามาจะเป็น String เพราะ Python จะอ่านโค้ดจากวงเล็บด้านในไปด้านนอกและจะถูกแปลงเป็นตัวเลขด้วย int() ก่อนที่จะถูกใช้ในการตัดสินใจ

จากนั้นจะนำค่าที่เป็นตัวเลขในตัวแปรไปเทียบ if-elif-else เพื่อดำเนินการต่างๆ ขึ้นอยู่กับตัวเลือกของผู้ใช้ หากผู้ใช้ป้อน 1 สคริปต์จะคำนวณพื้นที่ของวงกลม หากผู้ใช้ป้อน 2 สคริปต์จะคำนวณพื้นที่ของสี่เหลี่ยม หากผู้ใช้ป้อนอย่างอื่น สคริปต์จะพิมพ์ "หมายเลขเมนูไม่ถูกต้อง" และสิ้นสุด

@moking55
moking55 / love-algorithm.js
Created April 26, 2023 14:52
This algorithm will determine if two people are in love based on their personality traits.
// 1. Get the personality traits of each person.
// 2. Calculate the similarity between the two people's personality traits.
// 3. If the similarity is greater than a certain threshold, then the two people are in love.
// Here is an example of how to use the algorithm:
// var person1 = {
// personalityTraits: [
// "kind",
// "funny",
@moking55
moking55 / index.php
Created September 9, 2022 00:43
Exam PHP
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>โปรแกรมคำนวนเงินเดือน</title>
</head>
@moking55
moking55 / ข้อ 1
Created June 22, 2022 16:09
แนวทางการเขียนงาน Pseudocode made with 💘 by Codename_T
/* ข้อ 1 */
BEGIN
total = 0
counter = 1
WHILE counter <= 10
INPUT number
total = total + number
counters = counter + 1
@moking55
moking55 / Person.java
Created December 25, 2021 17:27
Lab02-ClassMethodRun Lab 1
public class Person {
public static void main(String[] args) {
Wallet dad = new Wallet();
Wallet mom = new Wallet();
Wallet son = new Wallet();
// init table
System.out.println("Date Name Type amount total\n");
dad.SetStatements("21/12/2014", "กด ATM", "income", 500);
@moking55
moking55 / cs111_oop.py
Created October 14, 2021 03:20
Discord OOP
# OOP 1
class stats:
def __init__(self, data):
self.data = data
def mean(self):
mean = sum(self.data)/len(self.data)
return mean
def min(self):
min_value = min(self.data)
return min_value
@moking55
moking55 / Readme.md
Last active October 6, 2021 12:21
Simple Discord music bot with voice recognition