Skip to content

Instantly share code, notes, and snippets.

View ap-Codkelden's full-sized avatar
🏠
Working from home

Renat ap-Codkelden

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# test
# head -c 10M 17.1-EX_XML_EDR_UO_FULL_29.05.2020.xml > test.xml
# XML_FILES=test.xml
XML_FILES=17*.xml
for f in $XML_FILES
do
@ap-Codkelden
ap-Codkelden / rtf2txt.vb
Last active July 24, 2020 23:37
RTF to TXT
' converts all *.rtf in the current directory to *.txt
' WdCompatibilityMode enumeration(Word) 07.06.2019
' Name Value Description
' wdCurrent 65535 Compatibility mode equivalent to the latest version of Word.
' wdWord2003 11 Word is put into a mode that is most compatible with Word 2003. Features new to Word are disabled in this mode.
' wdWord2007 12 Word is put into a mode that is most compatible with Word 2007. Features new to Word are disabled in this mode.
' wdWord2010 14 Word is put into a mode that is most compatible with Word 2010. Features new to Word are disabled in this mode.
' wdWord2013 15 Default. All Word features are enabled.
@ap-Codkelden
ap-Codkelden / osm_street_parse.py
Last active May 1, 2020 10:00
fix street names in OSM Overpass XML file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Nasridinov Renat
# MIT License
import argparse
import logging
import re
import sys
from lxml import etree
find . -type d -print0 | while read -d '' -r dir; do
files=("$dir"/*)
printf "%5d files in directory %s\n" "${#files[@]}" "$dir"
done
@ap-Codkelden
ap-Codkelden / When_Sysadmins_Ruled_the_Earth.txt
Last active January 30, 2020 20:27
When Sysadmins Ruled the Earth
Copyright 2006 by Cory Doctorow.
Creative Commons License Deed
Attribution-NonCommercial-ShareAlike 2.5
When Sysadmins Ruled the Earth
Introduction to When Sysadmins Ruled the Earth
I’ve changed careers every two or three years ever since I dropped out of university in 1990,
@ap-Codkelden
ap-Codkelden / eliky.py
Created December 24, 2019 11:58
eliky API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests # http requests
import time
import json
E_SERV = "https://eliky.in.ua" # server address
path = "/api/medicament" # server path
@ap-Codkelden
ap-Codkelden / doppels.csv
Created October 9, 2019 23:12
Rajons and cities that have same names within one Oblast
koatuu name type
0510400000 МОГИЛІВ-ПОДІЛЬСЬКИЙ М
0522600000 МОГИЛІВ-ПОДІЛЬСЬКИЙ Р
0710200000 ВОЛОДИМИР-ВОЛИНСЬКИЙ М
0720500000 ВОЛОДИМИР-ВОЛИНСЬКИЙ Р
0721400000 КАМІНЬ-КАШИРСЬКИЙ Р
0721410100 КАМІНЬ-КАШИРСЬКИЙ М
1811000000 НОВОГРАД-ВОЛИНСЬКИЙ М
1824000000 НОВОГРАД-ВОЛИНСЬКИЙ Р
3211000000 ПЕРЕЯСЛАВ-ХМЕЛЬНИЦЬКИЙ М
@ap-Codkelden
ap-Codkelden / drv_geojson.py
Created January 28, 2019 17:48
Grab State Voters Registry Precincts GeoJSON data
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import lxml.html
import os
import re
import requests
import time
@ap-Codkelden
ap-Codkelden / merge.py
Created December 23, 2018 19:00
gergstat_merger
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
import sys
import re
from os import scandir
main_container = []
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
with open('data.csv') as f:
reader = csv.reader(f, delimiter=';', quotechar='"')
rows = [x for x in reader][1:]
c = {}