Skip to content

Instantly share code, notes, and snippets.

@trueroad
trueroad / zrmakecmap.lua
Created February 18, 2019 12:06 — forked from zr-tex8r/zrmakecmap.lua
To make CMap files from OpenType font files using texlua
-- zrmakecmap.lua
prog_name = "zrmakecmap"
version = "0.3"
mod_date = "2015/10/09"
verbose = false
sort = false
inencoding = "utf16"
fwid = true
---------------------------------------- preparations
filename, fontname, outname, jis_map = nil
@trueroad
trueroad / Makefile
Last active October 29, 2019 14:24
Suppress echo back
BIN = sample
OBJS = sample.o tr_util_suppress_echo_back.o
all: $(BIN)
.PHONY: all clean
DEPS = $(OBJS:.o=.d)
CPPFLAGS += -MMD -MP -MF $(@:.o=.d) -MT $@
-include $(DEPS)
@trueroad
trueroad / Makefile
Last active November 3, 2019 09:44
tr_hash: C++ class library for hash calculation
BIN = sample
OBJS = sample.o tr_hash_gnutls.o
all: $(BIN)
.PHONY: all clean
CXXFLAGS += -std=c++11
LDLIBS += -lgnutls
@trueroad
trueroad / gist:82235de24b12bd93cb40781a61922cfa
Last active November 16, 2019 17:19
Date and time utility
We couldn’t find that file to show.
@trueroad
trueroad / mboxrd2eml.pl
Last active December 24, 2019 12:11
mboxrd2eml: mbox (mboxrd) to eml converter
#!/usr/bin/perl
#
# mboxrd2eml: mbox (mboxrd) to eml converter
# https://gist.github.com/trueroad/f84501c515eade77fd0199427ab615d3
#
# Copyright (C) 2019 Masamichi Hosoda.
# All rights reserved.
# License: BSD-2-Clause
#
@trueroad
trueroad / eml2txt.py
Last active December 24, 2019 15:00
eml2txt: eml to text converter
#!/usr/bin/python3
#
# eml2txt: eml to text converter
# https://gist.github.com/trueroad/a444f5432f91d335f5588f47a4ce9118
#
# Copyright (C) 2019 Masamichi Hosoda.
# All rights reserved.
# License: BSD-2-Clause
#
@trueroad
trueroad / rm-trailing-0.c
Last active January 23, 2020 13:44
Remove trailing zeros
#include <stdio.h>
int main (int argc, char *argv[])
{
if (argc != 3)
{
fprintf (stderr, "usage: rm-trailing-0 [INPUT.bin] [OUTPUT.bin]\n");
return 1;
}
@trueroad
trueroad / .dir-locals.el
Last active February 10, 2020 13:29
Regex dispatcher table for C++11
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
((c++-mode
(c-default-style . "gnu")
(indent-tabs-mode)))
@trueroad
trueroad / perl-win32-w-api-sample.pl
Last active March 17, 2020 11:53
Perl Win32 -W API sample
use strict;
use utf8;
use Encode;
use Win32::API;
my $messagebox = Win32::API::More->new (
"user32.dll",
"int MessageBoxW (HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType)"
) or die ("failed new");
@trueroad
trueroad / link-copy-cidfont.pl
Last active March 18, 2020 10:11
Link or copy TEXMF CID font file to Ghostscript CIDFont directory