Skip to content

Instantly share code, notes, and snippets.

@ccritchfield
ccritchfield / _vba_util_timer.readme
Last active December 5, 2019 04:09
VBA Process Timer
----------------------------------
VBA Process Timer Utility
----------------------------------
wrote this years back when I was doing a lot of vba work.
basically creates a process timer stack to add / pop timers
from, making it easy to add timers to code and track multiple
ones to see how multiple parts of a process are running.
.. test for speed, see where bottleneck is, etc.
You can also make it return the time as a string,
so you can use it to quickly create log files of code runs.
@ccritchfield
ccritchfield / _zip_backup.readme
Last active December 5, 2019 04:10
VBS - Zip Up Folder (using FBZip.exe)
--------------------------------------------
Windows Command-line Zip Automation
--------------------------------------------
VBS / VBScript / WScript that uses FBZip.exe to automate zipping
up folders and archiving them into a folder. Runs from DOS commandline,
and can task schedule to fire off and run after-hours for archiving /
back-ups.
Uses FBZip, b/c it's a small free zip program that has easy-to-use
@ccritchfield
ccritchfield / _backup_folders.readme
Last active December 5, 2019 04:11
DOS - Backup Folders (XCOPY)
----------------------------------------------
Windows Command-line Folder Copy Automation
----------------------------------------------
DOS / Windows Commandline script to automate folder copies / backups.
Can task schedule to do folder archiving after-hours.
IT would have a nightly backup of things, but created some backup
scripts to copy whole project folders into backups. This let me
quickly restore something if I was working on things or someone
@ccritchfield
ccritchfield / _compacter.readme
Last active December 5, 2019 04:11
DOS - MS Access Compacting Script
----------------------------------------------
Windows Command-line MS Access DB Compact Automation
----------------------------------------------
DOS / Windows Command-line script that compacts MS Access databases.
Checks if db is open (.ldb file exists) and skips compacting that db
if it does. Can task schedule to run after-hours for maintenance.
Purpose ...
@ccritchfield
ccritchfield / market_basket_analysis.r
Last active December 5, 2019 04:12
R - Affinity Analysis (Market Basket Analysis)
#--------------------------------------------
# R affinity / market-basket analysis
#--------------------------------------------
# if someone picks X, how likely would they
# be to pick Y or YZ. Or, if they picked XY
# together, how likely they'd pick Z. Etc.
#
# This serves two fold purpose..
# 1) we can make a recommender system.. based on
# things they picked together, or picked one and
@ccritchfield
ccritchfield / _process_timer.readme
Last active December 5, 2019 04:14
Python - Process Timer
--------------------------------------------
Python Code Timer
--------------------------------------------
Quick-n-dirty Python code timer. Add a line of code
before and after the code you want to time to kick
off a timer then return it when done processing.
Can have multiple timers going to test speed /
bottlenecks of various parts of code.
@ccritchfield
ccritchfield / _vba_util_array.readme
Last active December 5, 2019 04:15
VBA Spreadsheet to Array (and vice-versa)
----------------------------------
VBA Excel Spreadsheet to Array (and back)
----------------------------------
Func's to push a spreadsheet into a VBA array for processing,
then dump an array back to a spreadsheet.
Purpose ...
Had a coding interview challenge where I needed to take a year's
@ccritchfield
ccritchfield / _vba_util_holiday.readme
Last active December 5, 2019 04:28
VBA Holiday Generate & Check
----------------------------------
VBA Holiday Creation & Determination
----------------------------------
Various Holiday Func's that determine what date a holiday
is on based on the year you pass them. EG: Pass the Memorial
Day function the year 2025, and it will figure out when Memorial
Day is in 2025.
HolidayCheck func leverages these "when's the holiday date?"
---------------------------------------
VBA Excel Utilties
---------------------------------------
Excel is a great tool for quick-n-dirty analysis.
But, staring at raw data in it can be a pain. So,
I created misc utilities to pull in data from SQL
servers, format data, border-split rows to group
similar data together, dupe-check data (made this
before MS got smart and built a version into later
@ccritchfield
ccritchfield / _samplesize.readme
Last active December 13, 2019 18:34
Python - Sample Sizing Big Data To Reduce Processing
-----------------------------------------
Sample Sizing Big Data to Reduce Processing
-----------------------------------------
When grinding massive data sets, it'd be nice to
figure out a statistically supported subset sample
size you could come up with and run instead, that
way you could cut down on the time and resources
needed to come up with some results. IE: instead
of spending tons of time and resources grinding