Skip to content

Instantly share code, notes, and snippets.

View jeremyephron's full-sized avatar

Jeremy Ephron Barenholtz jeremyephron

View GitHub Profile
@jeremyephron
jeremyephron / c.Makefile
Created September 17, 2020 18:58
General C and C++ Makefile templates
# A C Makefile Template
# Author: Jeremy Barenholtz
# -------------------------
# This is a fully functional but primarily an educational document, with far
# too many explanatory comments. I hope you consolidate and modify this to
# suit your particular project's needs.
# The names of the programs you want to compile. The convention is that you
# have a <program>.c file containing the main() of the program. E.g., if
# you have a program named myprogram and defined in file myprogram.c,
@jeremyephron
jeremyephron / script_lock.py
Last active December 11, 2024 07:27
A script lock in Python to prevent the same script from being run more than once at a time
import errno
import fcntl
from pathlib import Path
def lock_script() -> bool:
"""
Locks a file pertaining to this script so that it cannot be run simultaneously.
Since the lock is automatically released when this script ends, there is no
need for an unlock function for this use case.
@jeremyephron
jeremyephron / stdtypes.py
Last active May 12, 2025 01:55
Qt Creator Debug Visualizer Fix for std::map, std::set, std::unordered_map, and std::unordered_set
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the commercial license agreement provided with the
@jeremyephron
jeremyephron / google_finance_intraday.py
Last active September 11, 2017 09:11 — forked from lebedov/google_finance_intraday.py
Retrieve intraday stock data from Google Finance.
#!/usr/bin/env python3
"""
Retrieve intraday stock data from Google Finance.
"""
import csv
import datetime
import re
import codecs