Skip to content

Instantly share code, notes, and snippets.

@chrissimpkins
chrissimpkins / FontPreview.swift
Created December 24, 2015 13:47 — forked from leonbreedt/FontPreview.swift
Render font from command line on OS X without requiring font to be installed.
//
// FontPreview
// Copyright © 2015 Leon Breedt
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@chrissimpkins
chrissimpkins / cythonrun.py
Created January 11, 2016 19:32 — forked from brentp/cythonrun.py
run a cython .pyx file
#!/usr/local/bin/python
"""
build and run a .pyx file with dependencies.
runs a main() function if it exists.
automatically detects 'cimport numpy'
and includes headers. other includes/libs specificed by command-line args.
%prog [options] source.pyx dep1.c dep2.c
@chrissimpkins
chrissimpkins / fontsmoothie.js
Created January 26, 2016 01:50 — forked from letorbi/fontsmoothie.js
This code enforces font-smothing for web fonts even if it's not enabled in the system settings. More info: http://pixelsvsbytes.com/blog/2013/02/nice-web-fonts-for-every-browser
// Font Smoothie copyright 2013,14,15 Torben Haase <http://pixelsvsbytes.com>
// Source-URL <https://gist.github.com/letorbi/5177771>
//
// Font Smoothie is free software: you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option) any
// later version.
//
// Font Smoothie is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@chrissimpkins
chrissimpkins / hack4tex
Last active October 14, 2021 14:31 — forked from gramian/hack4tex
A small script to use the hack truetype font in pdflatex
#!/bin/sh
# hack4tex 0.1
# Copyright (c) 2016 Christian Himpe
# released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause )
# based on Stephan Lehmke's answer to "How do I use TrueType Fonts with PDFTeX
# using otftotfm?" on tex.stackexchange.com/a/52902
#
# requires otftotfm which is part of lcdf-typetools
#
@chrissimpkins
chrissimpkins / osxiconsrc
Created April 1, 2016 21:47
Hide and show desktop icon aliases for OS X
alias killicons='defaults write com.apple.finder CreateDesktop -bool false;killall Finder;'
alias showicons='defaults write com.apple.finder CreateDesktop -bool true;killall Finder;'
#!/bin/bash
# icoconv.sh
# Copyright 2016 Christopher Simpkins
# Adapted from shell script by Denilson Sá at https://superuser.com/questions/40623/icons-command-line-generator#40629
# MIT License
# Dependencies:
# 1. imagemagick (http://www.imagemagick.org/)
# 2. icoutils (http://www.nongnu.org/icoutils/)
@chrissimpkins
chrissimpkins / fpfix.py
Last active August 6, 2017 02:23
Converts the isFixedPitch post table setting in a font to a value of 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
### DEPENDENCY:
# fontTools Python library
# ==> https://github.com/fonttools/fonttools
# ==> Install: pip install fonttools
### USAGE:
# python fpfix.py [filepath to font]
@chrissimpkins
chrissimpkins / config.log
Created August 29, 2017 16:57
config.log for ttfautohint-build run on OS X 10.10
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ttfautohint configure 1.7, which was
generated by GNU Autoconf 2.69. Invocation command line was
@chrissimpkins
chrissimpkins / stddef.h
Last active August 30, 2017 14:42
stddef.h examination for gnulib ttfautohint build bug (OS X 10.10 - Travis default build)
/*===---- stddef.h - Basic type definitions --------------------------------===
*
* Copyright (c) 2008 Eli Friedman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@chrissimpkins
chrissimpkins / todo_py_source.py
Last active October 4, 2017 16:18
TODO logs Python source example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# file: pydoc.py
# TODO this needs a lot of this and that
class PythonThreeDocObj(object):
...
# TODO more things that I need to do