Skip to content

Instantly share code, notes, and snippets.

View ManotLuijiu's full-sized avatar
🏠
Working from home

Manot Luijiu ManotLuijiu

🏠
Working from home
View GitHub Profile
@ManotLuijiu
ManotLuijiu / erpnext-translation.service
Last active March 21, 2025 06:51
Systemd script for automate translation in Frappe/ERPNext
[Unit]
Description=ERPNext Thai Business Suite Translation Updater
After=network.target
[Service]
Type=oneshot
User=frappe
Group=frappe
WorkingDirectory=/home/frappe/moo-bench
ExecStart=/bin/bash -c '/usr/local/bin/bench update-po-files --app thai_business_suite && /usr/local/bin/bench compile-po-to-mo --app>
@ManotLuijiu
ManotLuijiu / uninstall.py.new
Created March 17, 2025 13:45
print_designer uninstall.py (new)
import frappe
def before_uninstall():
# Remove Print Format record
if frappe.db.exists("Print Format", "Print Designer"):
frappe.delete_doc("Print Format", "Print Designer")
# Remove Print Designer entries from property setter
property_setters = frappe.get_all(
"Property Setter",
@ManotLuijiu
ManotLuijiu / CardImage.tsx
Last active September 19, 2024 06:35
Migrate SST from V2 to V3 on Next.js app router project
// // @/components/Dashboard/CardImage/CardImage.tsx
interface CardImageProps {
lastFourDigits: string;
cardType: string;
}
export default function CardImage({ lastFourDigits, cardType }: CardImageProps) {
const apiUrl = process.env.NEXT_PUBLIC_API_URL; // Set this in your environment variables
const imageUrl = `${apiUrl}/api/card-image?lastFourDigits=${lastFourDigits}&cardType=${cardType}`;
@ManotLuijiu
ManotLuijiu / chat-bot-hook.ts
Last active August 8, 2024 06:02
Disable Dark Mode in <iframe> Tag
useEffect(() => {
window.addEventListener('message', (e) => {
const { disableDarkMode, id } = e.data;
const botId = id;
if (disableDarkMode) {
document.body.style.backgroundColor = 'white';
document.body.style.color = 'black';
document.body.classList.remove('dark-mode');
}
@ManotLuijiu
ManotLuijiu / lazada.py
Last active July 24, 2024 10:39
Import Purchase Order from Lazada to ERPNext
import local_config as config
import pandas as pd
import numpy as np
import requests
# ERPNext API credentials
# api_url = config.ERPNEXT_URL_15_ERP + "/api/resource/Sales Invoice" or
api_url = "https://your-erpnext-url/api/resource/Sales%20Invoice"
api_key = config.ERPNEXT_API_KEY_ADMIN_15_ERP
api_secret = config.ERPNEXT_API_SECRET_ADMIN_15_ERP
@ManotLuijiu
ManotLuijiu / aws_command.log
Last active July 21, 2024 02:16
AWS CLI Command
aws s3 cp s3://your_bucket_name . --recursive --profile your_profile_name
@ManotLuijiu
ManotLuijiu / docker-compose.yml
Last active June 29, 2024 16:04
How to install Stirling PDF on Docker using docker-compose
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8080:8080'
volumes:
- ./trainingData:/usr/share/tessdata #Required for extra OCR languages
- ./extraConfigs:/configs
- ./customFiles:/customFiles/
@ManotLuijiu
ManotLuijiu / ansible.log
Last active June 23, 2024 11:06
ERROR! [DEPRECATED]: ansible.builtin.include has been removed.
ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks.
The error appears to be in '/usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
@ManotLuijiu
ManotLuijiu / ImportLazada2ERPNext
Last active June 15, 2024 06:47
Delete Columns in Lazada export file
Sub DeleteColumns()
Dim ws As Worksheet
Dim col As Range
' Set the worksheet you want to work on
Set ws = ThisWorkbook.Sheets("ALL")
' Specify the columns you want to delete
' You can specify columns by their letters or numbers (e.g., "A", "C", "E" or 1, 3, 5)
Dim columnsToDelete As Variant
@ManotLuijiu
ManotLuijiu / Dockerfile
Last active June 13, 2024 05:16
Install Coder's Workspace on Docker. In case you want to use locales, zsh and Oh-My-Zsh together with Coder-Server
FROM ubuntu
#FROM ubuntu:22.04 as base
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
curl \
git \
golang \
sudo \