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
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
import okhttp3.Response; | |
import okhttp3.ResponseBody; | |
import org.apache.commons.io.IOUtils; | |
import java.io.*; | |
import java.net.URL; |
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
@echo off | |
:: ========================================================== | |
:: Windows(64bit) batch file tor set environment variables | |
:: JAVA_HOME and PATH for Oracle JDK or OpenJDK. | |
:: | |
:: For Oracle JDK, search JDK installed path from Windows registory. | |
:: For OpenJDK, search JDK installed path from directory name under | |
:: OPENJDK_BASE directory specified in this batch file. (needs to | |
:: customize your configuration) |
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
@Test | |
public void testReusePage() throws Exception { | |
String original = resourceFile("PdfWithImage.pdf"); | |
String destination = targetFile("image-reuse-ReusePage.pdf"); | |
try ( | |
PdfDocument input = new PdfDocument(new PdfReader(original)); | |
PdfDocument output = new PdfDocument(new PdfWriter(destination)) | |
) { | |
PdfPage page = input.getPage(1); |
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
public class GuessContentTypeTest extends TestCase { | |
@Test | |
public void testGuessFileTypeFromUrl() throws Exception { | |
String[] urls = { | |
// your image urls here | |
}; | |
for(String s : urls) { | |
int pushbackLimit = 100; |
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
div.paymentmethodlist>input[value="PAYPAL"] ~ label:after { | |
background-repeat: no-repeat; | |
background-image: url(/images/payments/paypal-640x188.png); | |
background-size: 48px 14px; | |
display: inline-block; | |
width: 48px; | |
height: 14px; | |
content: ""; | |
margin-left: 20px; |
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
class TextBox { | |
private UUID uuid; | |
private float x; | |
private float y; | |
private float width; | |
private float height; | |
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
class TTFontInfo(object): | |
bold_names = ("bold", "demibold", "demi-bold", "demi bold", "negreta", "demi",) | |
italic_names = ("italic", "cursiva", "oblique", "inclined",) | |
bold_italic_names = ("bolditalic", "bold-italic", "bold italic", "boldoblique", "bold-oblique", | |
"bold oblique", "demibold italic", "negreta cursiva", "demi oblique",) |
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 document.transform; | |
import com.itextpdf.kernel.geom.AffineTransform; | |
import com.itextpdf.kernel.geom.Point; | |
import junit.framework.TestCase; | |
import org.junit.Test; | |
public class AffineTransformTests extends TestCase { |
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
VM=`docker-machine ls 2>/dev/null | sed -n 2p | awk '{print $1}'` | |
[ -z "$VM" ] && VM=default |
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
import os | |
import posixpath | |
import urllib | |
import BaseHTTPServer | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
# modify this to add additional routes | |
ROUTES = ( | |
# [url_prefix , directory_path], | |
['', 'E:\Dropbox\Other\python-server'], # empty string for the 'default' match |
NewerOlder