Author: Chris Lattner
This file contains hidden or 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
| var trimCanvas = (function() { | |
| function rowBlank(imageData, width, y) { | |
| for (var x = 0; x < width; ++x) { | |
| if (imageData.data[y * width * 4 + x * 4 + 3] !== 0) return false; | |
| } | |
| return true; | |
| } | |
| function columnBlank(imageData, width, x, top, bottom) { | |
| for (var y = top; y < bottom; ++y) { |
This file contains hidden or 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
| import Foundation | |
| /// Writes a canonical hex+ASCII representation of `bytes` into `output`. | |
| func hexdump<Target>(_ bytes: UnsafeRawBufferPointer, to output: inout Target) | |
| where Target: TextOutputStream | |
| { | |
| guard bytes.count > 0 else { return } | |
| var asciiString = "" |
This file contains hidden or 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 | |
| ''' | |
| List all available versions of Kindle for Mac and Kindle for PC. | |
| Dependencies: | |
| - asyncio==3.4.3 | |
| - aiohttp==3.6.3 | |
| ''' | |
| import os | |
| import sys |