Skip to content

Instantly share code, notes, and snippets.

View alpiepho's full-sized avatar
"java, java, java..."

Al Piepho alpiepho

"java, java, java..."
View GitHub Profile
@alpiepho
alpiepho / filterCsvDataOnly.py
Created September 27, 2017 17:05
Python - column and row duplication for HTM
#!/usr/bin/python
# NOTE: my first significant python script - AJP
import codecs
import csv
from datetime import datetime
import getopt
import os
import sys
@alpiepho
alpiepho / utf16toutf8.py
Last active July 8, 2019 18:58
Python - convert utf16 to utf8
import os, sys, codecs
src = ''.join(sys.argv[1:2])
dest = ''.join(sys.argv[2:3])
with open(src, 'rb') as source_file:
with open(dest, 'w+b') as dest_file:
contents = source_file.read()
dest_file.write(contents.decode('utf-16').encode('utf-8'))
@alpiepho
alpiepho / expandLogData.py
Last active September 29, 2017 20:14
Python - tool to expand THE ONE FILE columns and rows (with adjusted dates)
#!/usr/bin/python
from datetime import datetime
import getopt
import os
import sys
TD_HEADER = "<td isi-data-column-header"
TR_DATA = "<tr class=\"data\" isi-data-row"
TR_DATAMARKED = "<tr class=\"data-marked\" isi-data-row"
@alpiepho
alpiepho / parseLogToCsv.py
Created October 1, 2017 21:58
Python - tool to parse THE ONE FILE and pull out data as a CSV file
#!/usr/bin/python
import getopt
import os
import sys
def Usage():
print("Usage: %s -i <file> -o <file>" % sys.argv[0])
print(" -i <file> Input HTM file")
print(" -o <file> Output CSV file")
@alpiepho
alpiepho / parseCsvToLog.py
Last active October 4, 2017 02:20
Python - tool to a template of THE ONE FILE and insert data from a CSV file
#!/usr/bin/python
# NOTE
# Need to back burner this. Proving too time consuming to re-create
# the various attributes from the CSV strings (not enough information)
# Either need helper from .Net or write this tool in .NET
@alpiepho
alpiepho / python-avoid_verision-conflicts.txt
Created May 24, 2019 02:54
Python: Avoid version conflicts with Virtual Environments
From [🐍PyTricks]: Avoid version conflicts with Virtual Environments
# Virtual Environments ("virtualenvs") keep
# your project dependencies separated.
# They help you avoid version conflicts
# between packages and different versions
# of the Python runtime.
# Before creating & activating a virtualenv:
# `python` and `pip` map to the system
@alpiepho
alpiepho / using_meld_on_mac.md
Last active June 25, 2024 07:52
Using meld on Mac

More Using Meld merging tool on Mac

After switching to 'Meld for Mac' from download instead of from homebrew, I saw problem again.

The problem is related how the app is closed. If you use the Menu option, the saved state is removed cleaning. If you close using the window close (read circle), the saved state remains. Somehow, when this there, the application will not open from command line. Sometimes it will open, but you need to manually switch to the Meld application from the tool bar.

To work around I added /Applications/Meld.app/Contents/MacOS/meld.wrapper.sh:

@alpiepho
alpiepho / all-github.py
Last active October 5, 2023 09:01
Simple python script to download all GitHub repos and gists for a given user.
#!/usr/bin/python
# python3 ./all-github.py -u <user> -d <directory>
#
# Tool to inspect Github and pull local copies of all repos and gists
# for the given user.
#
# Why? Every ask yourself the question 'I know I did this before, but
# which repos was it in?'
# With all files local, you can use any serach-in-files app to look.
@alpiepho
alpiepho / all-git-commits.py
Last active June 7, 2024 07:41
Simple python script to download all GitHub commits for a given repo.
#!/usr/bin/python
# python3 ./all-git-commits.py -u <user> -d <directory> -r <repo> -n <number of commits>
#
# Tool to inspect Github and pull local copies of all commits for
# for the given user.
#
# Why? Every ask yourself the question 'I know I did this before, but
# which repos commit was it in?'
# With all files local, you can use any serach-in-files app to look.
@alpiepho
alpiepho / all-git-branches.py
Last active July 8, 2019 17:01
Simple python script to download all GitHub branches for a given repo.
#!/usr/bin/python
# python3 ./all-git-branches.py -u <user> -d <directory> -r <repo> -n <number of commits>
#
# Tool to inspect Github and pull local copies of all commits for
# for the given user.
#
# Why? Every ask yourself the question 'I know I did this before, but
# which repos commit was it in?'
# With all files local, you can use any serach-in-files app to look.