Skip to content

Instantly share code, notes, and snippets.

View sacko87's full-sized avatar

John T. Saxon sacko87

View GitHub Profile
@sacko87
sacko87 / wrapper.py
Last active February 3, 2019 13:55
A logger that works between multiprocessing Processes.
import logging
import os
import signal
from logging.handlers import QueueHandler, RotatingFileHandler, QueueListener
from multiprocessing import Manager
DEBUG = os.environ.get("DEBUG", False)
@sacko87
sacko87 / regex.01.c
Created September 11, 2012 09:26
Regular Expressions in C
/**
* file : regex.match.1.c
* author : John Saxon (09-Mar-2010)
* revision : $Rev$
*
* this program is to demonstrate how to use the POSIX regular
* expression functions (defined in regex.h).
*
* this particular program shows you how to simply say whether
* a give string (argv[1]) is a match for a given regular
@sacko87
sacko87 / Base.cpp
Last active December 10, 2023 09:14
Factory Pattern in C++ with templates (using the confusingly recurring template and registry patterns)
#include "Base.h"
Base::Base() :
IsRegistered_(false)
{ }
Base::Base(bool isRegistered) :
IsRegistered_(isRegistered)
{ }