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 subprocess | |
html = '<p><strong>Hello</strong> <em>Bob</em> <code>How</code> are you!</p>' | |
def setClipboardData(html): | |
# print(html) | |
p_hex = subprocess.Popen( | |
('hexdump', '-ve', '1/1 "%.2x"'), | |
stdin=subprocess.PIPE, | |
stdout=subprocess.PIPE |
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
#!/bin/bash | |
# Run cputhrottle for a list of applications in order to limit their CPU usage. | |
# This script needs `pidof` and `cputhrottle` installed, which can be installed from homebrew. | |
# NOTE: This script was tested on MacOS only. | |
if [[ $EUID > 0 ]]; then | |
echo "Please run this script as root/sudo" | |
exit 1 | |
fi |
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 com.itextpdf.text.BadElementException; | |
import com.itextpdf.text.Image; | |
import com.itextpdf.text.pdf.codec.Base64; | |
import org.w3c.dom.Element; | |
import org.xhtmlrenderer.extend.FSImage; | |
import org.xhtmlrenderer.extend.ReplacedElement; | |
import org.xhtmlrenderer.extend.ReplacedElementFactory; | |
import org.xhtmlrenderer.extend.UserAgentCallback; | |
import org.xhtmlrenderer.layout.LayoutContext; | |
import org.xhtmlrenderer.pdf.ITextFSImage; |