Skip to content

Instantly share code, notes, and snippets.

View davidmintz's full-sized avatar

David Mintz davidmintz

View GitHub Profile
@davidmintz
davidmintz / parse-html-email.py
Created August 22, 2019 14:45
quick and dirty html extraction for .eml files
#!/usr/bin/env python3
# useful for development and testing, this gets the html payload from
# .eml files (e.g., as produced by Zend\Mail) and prints it to STDOUT
from email import parser;
import argparse;
args = argparse.ArgumentParser()
args.add_argument("filename", help="path to .eml file")
@davidmintz
davidmintz / AppExtension.php
Last active February 22, 2022 04:05
Symfony/Twig filter for rendering US 10-digit phone numbers +1xxxxxxxxx as (xxx) xxx-xxxx
<?php
namespace App\Twig;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
class AppExtension extends AbstractExtension
{
public function getFilters() : Array
{
@davidmintz
davidmintz / survey.php
Last active January 8, 2024 01:18
quick and dirty survey in PHP and Javascript
<?php
/**
* collect and record a "vote" for a simple survey with one question, three choices.
*
* I thought it would be so simple that it would be easy to do in one physical file without
* getting too monolithic. Not so. But... oh well.
*/
/**