Skip to content

Instantly share code, notes, and snippets.

View m7mdyahia's full-sized avatar

Mohammad Yahia m7mdyahia

View GitHub Profile
@m7mdyahia
m7mdyahia / reverse_xml.py
Created April 4, 2018 11:04
Reverse XML using python
import xml.etree.ElementTree as ET
tree = ET.parse('changelog.xml')
root = tree.getroot()
r=ET.Element('changelog')
ree = ET.ElementTree(r)
for child in reversed(root):
r.append(child)
ree.write('output.xml')
@m7mdyahia
m7mdyahia / parse_arabic_date.py
Last active February 26, 2018 12:30
Parse Arabic dates
import datetime
import re
arabic_month_names=[None,'يناير',
'فبراير',
'مارس',
'إبريل',
'مايو',
'يونيو',
'يوليو',
@m7mdyahia
m7mdyahia / .sh
Created January 19, 2018 14:40
compare two directories neglecting extensions linux shell
diff <(find books -type f -exec bash -c 'basename "${0%.*}"' {} \; | sort) <(find cbooks -type f -exec bash -c 'basename "${0%.*}"' {} \; | sort)