Skip to content

Instantly share code, notes, and snippets.

Avatar

Zearin Zearin

  • Virginia, U.S.A.
View GitHub Profile
@Zearin
Zearin / metalsmith3-design-goals.md
Last active Jul 6, 2018
Goals for Metalsmith v3 (WIP)
View metalsmith3-design-goals.md

Metalsmith v3 Goals

“Big Picture” Goals

  • Modern ES code. ES/JS moves fast these days. I want Metalsmith 3 to be best-in-class, and stay best-in-class for several years.

  • Performance (with Scalability). If Metalsmith 3 can boast performance that is so good, big companies with big websites start using it, that would be pretty fantastic. :)

  • Convenience.

@Zearin
Zearin / python_decorator_guide.md
Last active Feb 27, 2021
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)
View python_decorator_guide.md

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

View gist:9d750721d37af7507c45

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings, TextMate will look for a .tm_properties file in the current folder, and in any parent folders (up to the user’s home folder).

These are simple «setting» = «value» listings, where «value» is a format string in which other variables can be referenced.

@Zearin
Zearin / OrderedSet.py
Last active Dec 17, 2015
An OrderedSet for Python.
View OrderedSet.py
# -*- coding: utf-8 -*-
# Modified from original source, available here:
# http://code.activestate.com/recipes/577624-orderedset/
try:
import collections.abc as collections # Python 3
except ImportError:
import collections # Python 2
@Zearin
Zearin / brew-more.rb
Created Sep 16, 2011 — forked from lwe/brew-more.rb
Try to scrape formula information from @formula.homepage.
View brew-more.rb
# Small utility which uses the homepage and nokogori to get a description from the formula's homepage.
#
# As written in the homebrew wiki:
# > Homebrew doesn’t have a description field because the homepage is always up to date,
# > and Homebrew is not. Thus it’s less maintenance for us. To satisfy the description
# > we’re going to invent a new packaging microformat and persuade everyone to publish
# > it on their homepage.
#
# Too bad no packaging microformat has yet been invented, but brew-more just first looks for a
# `<meta name="description">` tag, then for an `a#project_summary_link` tag (which is used in
@Zearin
Zearin / icon-naming-spec.xml
Created May 31, 2011
Freedesktop.org’s icon naming specification, represented as XML. Intended as a convenience to XML devs.
View icon-naming-spec.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
@source
http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
@author
Zearin <zearin@gonk.net>
@license
I haven’t chosen a license yet. In the meantime, feel free to reuse this
@Zearin
Zearin / brew-more.rb
Created May 28, 2011 — forked from lwe/brew-more.rb
Try to scrape formula information from @formula.homepage.
View brew-more.rb
# Small utility which uses the homepage and nokogori to get a description from the formula's homepage.
#
# As written in the homebrew wiki:
# > Homebrew doesn’t have a description field because the homepage is always up to date,
# > and Homebrew is not. Thus it’s less maintenance for us. To satisfy the description
# > we’re going to invent a new packaging microformat and persuade everyone to publish
# > it on their homepage.
#
# Too bad no packaging microformat has yet been invented, but brew-more just first looks for a
# `<meta name="description">` tag, then for an `a#project_summary_link` tag (which is used in