Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mgray88 on github.
  • I am mgray88 (https://keybase.io/mgray88) on keybase.
  • I have a public key ASCsSoE64iG9qpWzPoo5VCJb2RMpyAu9WmkTNbuPcNkGhwo

To claim this, I am signing this object:

@mgray88
mgray88 / android-vector-drawable-to-svg.xsl
Created October 1, 2021 14:29 — forked from ok3141/android-vector-drawable-to-svg.xsl
Convert Android Vector Drawable to SVG with XSLT
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<svg xmlns="http://www.w3.org/2000/svg">
<xsl:attribute name="width">
<xsl:value-of select="substring-before(vector/@width, 'dp')"/>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:value-of select="substring-before(vector/@height, 'dp')"/>
</xsl:attribute>
@mgray88
mgray88 / SortedDifference.kt
Created January 5, 2021 21:10
A general sequence diffing algorithm, with a very specific purpose
// Imitated from https://github.com/groue/SortedDifference
class SortedDifference<LeftSequence: Collection<LeftElement>, RightSequence: Collection<RightElement>, LeftElement, RightElement, ID: Comparable<ID>>(
private val left: LeftSequence,
private val leftID: (LeftElement) -> ID,
private val right: RightSequence,
private val rightID: (RightElement) -> ID
) : Iterable<SortedDifferenceChange<LeftElement, RightElement>> {
override fun iterator(): Iterator {
return Iterator(