Skip to content

Instantly share code, notes, and snippets.

View naiplawan's full-sized avatar
more coffee more work

Rachaphol Plookaom naiplawan

more coffee more work
View GitHub Profile
@naiplawan
naiplawan / prompt.md
Created June 20, 2025 09:34
Code Security Scanner Prompt

As a cybersecurity expert specializing in secure code analysis, I need you to perform a thorough security review of the provided code. Your analysis should adhere to the following framework and deliver a detailed report in Markdown forma and written in Markdown File :

My Secure Code Analysis Framework:

1. CIA Triad Assessment

  • Confidentiality: Identify data exposure risks, unauthorized access, improper access controls (principle of least privilege violations), weak encryption, unencrypted sensitive data, and information disclosure in error messages/logs.
  • Integrity: Verify data protection mechanisms by checking for input validation gaps (SQL injection, XSS, command injection), data sanitization issues, missing integrity checks (checksums, digital signatures), and race conditions that could corrupt data.
// GetByCompanyUUID godoc
// @Summary Get a company by UUID
// @Description Retrieve a single company by its UUID, including themes, employees, and users
// @Tags admin
// @Security BearerAuth
// @Accept json
// @Produce json
// @Param company_uuid path string true "Company UUID"
// @Success 200 {object} response.Response{data=dto.AdminCompanyManageDTOResponse}
// @Failure 400 {object} response.Response
@naiplawan
naiplawan / Allform
Created September 29, 2023 15:26
AllForm
import { useEffect, useState } from "react";
import { useNavigate, useParams } from "react-router-dom";
import Navbar from "../components/Navbar";
import arrowBlue from "../assets/CustomerPhoto/icons/arrow-blue.svg";
import arrowWhite from "../assets/CustomerPhoto/icons/arrow-white.svg";
import sellblack from "../assets/CustomerPhoto/icons/sellblack.svg";
import axios from "axios";
import dayjs from "dayjs";
import credit from "../assets/CustomerPhoto/icons/credit.svg";
import qr from "../assets/CustomerPhoto/icons/qr.svg";
@naiplawan
naiplawan / PromotionMockUpPage.jsx
Created September 28, 2023 03:52
Promotion Feature
import { useState } from "react";
import { Input, Button } from "antd";
import { usePromotion } from "../hooks/promotion";
const PromotionMockUpPage = () => {
const [promotionCode, setPromotionCode] = useState("");
const { promotion, getPromotion } = usePromotion();
const handleApplyPromotion = () => {
console.log("handleApplyPromotion called with promotionCode:", promotionCode);
@naiplawan
naiplawan / AllStepCheckOutForm(v2.0)
Last active September 28, 2023 02:15
AllStepCheckOutForm
import { useEffect, useState } from "react";
import { useNavigate,useParams } from "react-router-dom";
import Navbar from "../components/Navbar";
import arrowBlue from "../assets/CustomerPhoto/icons/arrow-blue.svg"
import arrowWhite from "../assets/CustomerPhoto/icons/arrow-white.svg";
import sellblack from "../assets/CustomerPhoto/icons/sellblack.svg";
import axios from "axios";
import dayjs from 'dayjs';
import credit from "../assets/CustomerPhoto/icons/credit.svg";
import qr from "../assets/CustomerPhoto/icons/qr.svg";
@naiplawan
naiplawan / AdminServiceList.jsx
Created September 21, 2023 08:17
Code in Project
import { useState, useEffect } from "react";
import { useNavigate } from "react-router-dom";
import dateFormat from "../../utils/dateFormat.js";
import AlertBoxDelete from "../AlertBox.jsx";
import image from "../../assets/AdminPhoto/imageIndex.js";
import axios from "axios";
import drag from "../../assets/AdminPhoto/drag.svg";
import { Droppable, Draggable, DragDropContext } from "react-beautiful-dnd";
function AdminServiceList() {
@naiplawan
naiplawan / AdminServiceHeader.jsx
Last active September 19, 2023 06:05
AdminServiceList
import "../../styles/App.css";
import {useEffect} from "react";
import { useNavigate } from "react-router-dom";
import axios from "axios";
import { useUtils } from "../../hooks/utils.js";
import image from "../../assets/AdminPhoto/imageIndex";
const AdminServiceHeader = () => {
const navigate = useNavigate();
const { searchService, setSearchService, setService } = useUtils;
@naiplawan
naiplawan / AdminDetailServicePage.jsx
Last active September 19, 2023 02:25
Home Service - DetailPage
import axios from "axios";
import { useState, useEffect } from "react";
import { useParams, useNavigate } from "react-router-dom";
import dateFormat from "../../utils/dateFormat.js";
import arrow from "../../assets/AdminPhoto/arrow.png";
function AdminDetailServicePage() {
const [service, setService] = useState({});
const navigate = useNavigate();
const params = useParams();
@naiplawan
naiplawan / authenticated(v1.0).jsx
Created September 18, 2023 10:24
Share Code in Project
import { Routes, Route } from "react-router-dom";
import HomePage from "./HomePage.jsx";
import NotFoundPage from "./NotFoundPage.jsx";
import AdminDashboard from "./AdminDashboard.jsx";
import AdminCategoryPage from "./AdminCategoryPage.jsx";
import AdminServicePage from "./AdminServicePage.jsx";
import AdminCreateCategory from "./AdminCreateCategory.jsx";
import AdminDetailCategory from "./AdminDetailCategory.jsx";
import AdminEditCategory from "./AdminEditCategory.jsx";
import AdminDetailService from "./AdminDetailService.jsx"