Skip to content

Instantly share code, notes, and snippets.

@esafwan
esafwan / Redline Docx.md
Last active April 16, 2025 05:53
Get and Add Redline on Docx using Pyton

Redlined Edits in Word (.docx) Using Low-Level OpenXML Manipulation

Objective

Create a tool that can programmatically insert suggested edits (redlined insertions, deletions, and replacements) into an existing .docx Word document. These edits should appear in Microsoft Word as tracked changes, identical to how human reviewers suggest edits.

Why Low-Level OpenXML?

Most established libraries for working with .docx files do not support tracked changes (like insertions and deletions that show up as suggestions in Word). Therefore, we manipulate WordprocessingML directly (OpenXML format) to produce tracked edits:

  • <w:ins> — Inserted text (appears as underlined suggestion)
  • <w:del> — Deleted text (appears as strikethrough suggestion)
  • Metadata (author, timestamp, revision ID)
@esafwan
esafwan / prompt.md
Created April 14, 2025 09:01
Midjourney to ChatGPT prompt for clear UI design.

You are an AI assistant tasked with reimagining and improving given app UI. Your goal is to create a clearer, more legible version of the UI while maintaining the original layout and structure. Attached is the original image you'll be working with

Please follow these steps to complete the task:

  1. Analyze the original image carefully, noting the overall layout, structure, and placement of elements.

  2. Identify all text elements and icons in the image, paying attention to their positioning and relative sizes.

  3. Reimagine the UI with clearer, more legible text and icons. Keep the following guidelines in mind: a. Use a clean, easy-to-read font for all text elements.

New table from the consolidated JSON.

Time Actor Message
10:26 AM - Dec 24 2024 Amani Glanza Hi . thank you for reaching out, this is Amani from Dieture and I noticed you downloaded our application recently the app called Dieture as well. I’m reaching out to let you know that I’m here to help you with all your questions and help you sign up for a plan of your choice .
10:26 AM - Dec 24 2024 Amani Glanza Conversation was marked resolved by Amani Glanza
10:26 AM - Dec 24 2024 Amani Glanza Assigned to Amani Glanza by Amani Glanza
10:26 AM - Dec 24 2024 Amani Tags: Pre sale question Summary: lead Agent name: Amani
10:32 AM - Dec 24 2024 Ahmed AlMushiri Hi Im Serena on behalf of Ahmed AlMushiri

FAQ - AfriConnect Mobile

  1. How do I check my remaining balance? You can Dial *123# and press call to instantly receive your account balance. For now, I will text you, your balance.

  2. What are the available prepaid plans?

Our prepaid plans include:

Daily Pack: 500MB data, 30 mins calls for $0.50/day

@esafwan
esafwan / doctype_gen.py
Created February 16, 2025 21:15
Frappe, ERPNext Doctype Generator
"""
Frappe DocType Generator
=======================
A utility to generate DocType JSON with standard settings and fields.
DocType Properties
----------------
1. Basic Settings:
- name: Name of the DocType
# Restaurant POS Application
 
This is a minimal yet fully functional restaurant POS application built with React. It includes features like item grid with category filtering, table selection, and a cart system, along with a payment modal that supports multiple payment types.
 
## Dir Structure:

public
@esafwan
esafwan / shadcn.md
Created January 19, 2025 07:42
Shadcn Component as markdown for LLM - as of 19 Jan 2025
Directory structure:
└── shadcn-ui-ui/
    └── apps/
        └── www/
            └── registry/
                └── default/
                    └── ui/
                        ├── accordion.tsx
                        ├── alert-dialog.tsx
@esafwan
esafwan / Frappe_Gameplan_Code.md
Created November 26, 2024 05:41
Frappe Gameplan Codebase as markdown
Error in user YAML: (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 2 column 1
---
### File: index.html
**Path:** `index.html`
**Type:** `.html`
---
<!doctype html>
<html class="h-full" lang="en">
  <head>
@esafwan
esafwan / How to use Codebase merger.md
Last active November 26, 2024 05:11
Compile directory with nested markdown files to a single page with metadata added.

Documentation for Using tree Command with the Code

The tree command is a useful utility to visualize the directory structure in a tree-like format. For the input directory structure used in the above Python script, tree can help ensure that the directory structure is correct before processing files.


Installing tree Command

For Linux

  • Most Linux distributions come with tree pre-installed.
@esafwan
esafwan / Readme.md
Last active April 18, 2025 01:59
Frappe CRM FrontEnd Code as Single File minus icons

Below is full frontend vuejs code for Frappe CRM. It uses Frappe UI(vue based) front-end framework built to build modern applications with Frappe Framework(python). Frappe UI is a set of components and utilities to build frontend apps based on the. Along with generic components which are required to build a frontend like Button, Link, Dialog, etc., frappe-ui also contains utilities for handling server-side data fetching, directives and utilities. It enables rapid UI development. Components are built using Vue 3 and Tailwind.

Key features of Frappe CRM

Key Features Views: Create custom views which is a combination of filters, sort and columns. Pinned View: Pin important leads and deals in the sidebar. Public View: Share views with all users. Saved View: Save views for later use. Email Communication: Send and receive emails directly from the Lead/Deal Page. Email Templates: Create and use email templates for faster communication.