This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019 Google LLC. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
#include "SkUTF.h" | |
#include "SkShaper.h" | |
#include "SkCanvas.h" | |
template <typename T, SkUnichar (*FN)(const T**, const T*)> | |
static SkString convert_to_utf8(const void* src, size_t srcBytes) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019 Google LLC. | |
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. | |
#include "SkPath.h" | |
#include "SkTextBlobPriv.h" | |
#include "SkRSXform.h" | |
SkPath SkTextBlobToPath(const SkTextBlob* blob) { | |
SkPath path; | |
for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) { | |
uint32_t runSize = it.glyphCount(); | |
const SkFont& font = it.font(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# Copyright 2020 Hal W Canary, III. all rights reserved. | |
import lxml.html | |
import subprocess | |
import sys | |
import urllib2 | |
class WikipediaTextParser: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INFO="$(diskutil ap list disk1)" | |
printf 'size: %14d\n' "$(printf %s "$INFO" | sed -n 's/ *Size (Capacity Ceiling): *\([0-9]*\).*/\1/p')" | |
printf 'use: %14d\n' "$(printf %s "$INFO" | sed -n 's/ *Capacity In Use By Volumes: *\([0-9]*\).*/\1/p')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
''' | |
Making SVGs by hand is a pain. This is a better way: | |
It's functional, rather than using the XML "markup language" directly. | |
No closing tags, just balanced parentheses! | |
#xml #svg #python #python3 #graphicsprogramming | |
https://twitter.com/halcanary/status/1458802118136111107 | |
Updated to use `xml.dom.minidom` instead of `lxml`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"regexp" | |
"sort" | |
"strings" | |
"golang.org/x/net/html" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"exec" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func ConvertToEbook(src, dst, title, authors, comments string) error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"net/url" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"log" | |
"os" | |
) | |
func expectNil(err error) { | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function E(tagName, clas, ...children) { | |
var e = document.createElement(tagName); | |
if (clas) { | |
e.className = clas; | |
} | |
for (const c of children) { | |
e.appendChild(c); | |
} | |
return e | |
} |