Skip to content

Instantly share code, notes, and snippets.

@tshinnic
tshinnic / opentype.js_operator_decode_debug
Created February 7, 2015 00:01
opentype.js 2-byte decoding and add operator/operand decode tracing
Combine 1- and 2 byte operator decoding, add trace
With the implementation of the flex operator variations 2-byte operators
are now "mainstreamed". Realign the operator code decoding so as to
have just one switch+case clause for all operators.
Additionally, add a debug trace while decoding operators and operands.
This has been useful elsewhere when hints were decoded badly, and useful
here recently to show that the flex operators were being exercised and
failing in a font file not tested before.
@tshinnic
tshinnic / valgrind_ff_p2.supp
Created August 7, 2014 01:57
Valgrind suppression file for FontForge built with Python 2
# This file for FontForge built with Python 2
#
# The below suppressions suppress just about every entry that Python
# could have contributed to. This is likely excessive... ;)
#
# We make good use of the wildcarding features of Valgrind. By using
# wildcarded function names we can cover more cases with just one entry.
# And by using wildcarded library object filenames we can hope this
# source is portable to more systems.
@tshinnic
tshinnic / valgrind_ff_pango.supp
Last active April 10, 2016 11:03
Valgrind suppression file for FontForge built with Pango
# The below suppressions suppress just about every entry that pango
# libraries could have contributed to. This is likely excessive... ;)
#
# We make good use of the wildcarding features of Valgrind. By using
# wildcarded library object filenames we can hope this source is
# portable to more systems.
# On one tested system (Ubuntu 14.04), these libraries are:
# /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0.3600.3
# /usr/lib/x86_64-linux-gnu/libpangoxft-1.0.so.0.3600.3
@tshinnic
tshinnic / valgrind_ff_p3.supp
Created August 2, 2014 19:23
Valgrind suppression file for FontForge built with Python 3
# This file for FontForge built with Python 3
#
# The below suppressions suppress just about every entry that Python
# could have contributed to. This is likely excessive... ;)
#
# We make good use of the wildcarding features of Valgrind. By using
# wildcarded function names we can cover more cases with just one entry.
# And by using wildcarded library object filenames we can hope this
# source is portable to more systems.
@tshinnic
tshinnic / test_stroke_overlap_simplify.svg
Created July 12, 2014 01:07
SVG test to demo broken remove overlap in FontForge circa commit 7535262b
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Large swatches copied from jQuery.
// "cargo-culting, makes me happy" Don Ho we love you!!
Snap.plugin(function (Snap, Element ) {
// Used for splitting on whitespace
var core_rnotwhite = /\S+/g,
rclass = /[\t\r\n\f]/g,
@tshinnic
tshinnic / httpclnt03.js
Created December 1, 2011 00:40
Example of binding socket for nodejs HTTP client request (for discussion only)
// One shot request HTTP client - show local/remote addresses
//
// Attempt to use a modified Agent that has own self.createConnection()
// that binds the client socket to a particular address.
var assert = require('assert'),
dns = require('dns'),
http = require('http'),
net = require('net'),
util = require('util');
@tshinnic
tshinnic / curl_bug_3421912_comments2.txt
Created October 16, 2011 21:43
Additional comments to curl bug report ID: 3421912
I stumbled on this oddity in wanting to use curl as a test tool, as yet another ftp client to test an FTP server. I needed to force use of PORT/EPSV when curl _really_ seemed to want to use ipv6 commands. In all my test cases, only ipv4 connections were used, as the FTP server software disallowed ipv6 connections.
I have struggled figuring out how to illustrate the 'problem', as I am having a hard time describing the weirdness here. It is as though, if curl thinks there is any possibility of ipv6 connections, it 'resists' ipv4-style commands. This could be a problem, the lack of flexibility, in a mixed environment, when curl 'guesses' wrong. Not all software/hardware is ready for ipv6 and curl requiring ipv6 commands could cause problems.
I'll first give the minimum information, my local /etc/hosts and then a table of options vs. actions. And I'll copy much of this to a 'gist' so that the formatting won't be messed up)
On a defaulted Fedora 15 Linux the /etc/hosts file has both ipv4 and ipv6 definiti
@tshinnic
tshinnic / yes_no_maybe01.js
Created September 21, 2011 13:51
Crude benchmarking of node 0.5.x Array, Buffer, Uint8Array
// Time a certain set of operations using Array, Buffer, Uint8Array
var classes_to_try = 'Array Buffer Uint8Array'.split(' ');
// Note that the "pool size" for Buffer is currently defaulted to 8192,
// so sizes under this will be satisfied using the pool slice method,
// but any size over this will go direct to SlowBuffer allocations.
var buffer_sizes = [100, 1000, 10000],
@tshinnic
tshinnic / gist:1148378
Created August 16, 2011 03:27
Possible elaboration on errnoException() for node 0.5.x
//XXX Maybe someday there will be a nice way for user-land modules to
// generate pseudo-errno errors?
function errnoException(errno, syscall, message, path) {
var e = new Error();
var msg = '';
if ( syscall !== undefined ) {
msg += syscall + ' ';