Skip to content

Instantly share code, notes, and snippets.

@ohwgiles
ohwgiles / tnef-gmime.c
Last active May 26, 2018 07:13
Extract TNEF to GMimeParts
#include <stddef.h>
#include <stdio.h>
#include <ytnef.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <gmime/gmime.h>
GSList* attachments_from_tnef_buffer(char* buffer, int size)
@ohwgiles
ohwgiles / glyphs_in_font.pl
Created November 10, 2013 12:52
test whether a font contains a glyph for a specified unicode character
#!/usr/bin/perl
# Reading fields from standard input, omit lines which contain
# a character which is absent in the specified font
# Make sure perl is invoked correctly (see PERL_UNICODE)
use Font::TTF::Font;
my $fontPath = "/usr/share/fonts/Adobe/AdobeKaitiStd.otf";
my $font = Font::TTF::Font->open($fontPath);
@ohwgiles
ohwgiles / fbeml
Last active December 14, 2015 10:18
python script to send a facebook photo album as an email (for those that don't use facebook)
#!/usr/bin/python
msg = "<html><head></head><body>"
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from urllib import request
import json
import os