Skip to content

Instantly share code, notes, and snippets.

PdfReader reader = new PdfReader(path);
Document document = new Document();
*PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest));*
PdfImportedPage page = writer.getImportedPage(reader, i);
*PdfImage img = Image.getInstance(page);*
reader.close();
https://kb.itextpdf.com/home/it5kb/faq/how-to-reuse-a-page-from-one-pdf-document-into-another-pdf-document
http://what-when-how.com/itext-5/making-images-transparent-itext-5/
http://javadox.com/com.itextpdf/itextpdf/5.5.8/com/itextpdf/text/pdf/PdfStamper.html
@lharland
lharland / CBS...1 helloworld.sol
Last active December 8, 2021 04:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.0+commit.1d4f565a.js&optimize=false&runs=200&gist=
pragma solidity 0.8.7;
contract HelloWorld {
string private stateVariable = "Hello world";
uint public var2 = 1;
function GetHelloWorld() public view returns(string memory)
{
return stateVariable;
}
@lharland
lharland / top-brew-packages.txt
Created May 28, 2021 02:59 — forked from pmkay/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
JAVA_HOME='/usr/libexec/java_home -v 11'
alias pddl="docker run -it --rm -v $PWD:/workspace cs4246/base python"
alias recordscr='/Users/leslieharland/ffmpeg/bin/ffmpeg -f avfoundation -r 1 -probesize 20M -threads 1 -i "1:" -vcodec libx264 -b:v 128k -s hd720 /Users/leslieharland/A0183975L.mp4'
alias tag='python buildtagger.py sents.train model-file'
alias view='python runtagger.py sents.test model-file sents.out; python eval.py sents.out sents.answer'