$ brew install webkit2png
$ webkit2png https://someweb.site/url
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
package com.zaxxer.miscmicro; | |
import java.util.concurrent.TimeUnit; | |
import org.openjdk.jmh.annotations.Benchmark; | |
import org.openjdk.jmh.annotations.BenchmarkMode; | |
import org.openjdk.jmh.annotations.Level; | |
import org.openjdk.jmh.annotations.Measurement; | |
import org.openjdk.jmh.annotations.Mode; | |
import org.openjdk.jmh.annotations.OutputTimeUnit; |
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 | |
export PW=`pwgen -Bs 10 1` | |
echo "$PW" > password | |
# Create a self signed certificate & private key to create a root certificate authority. | |
keytool -genkeypair -v \ | |
-alias clientCA \ | |
-keystore client.jks \ |
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
package com.zaxxer.hikari.pool; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import org.junit.Test; | |
import org.postgresql.PGConnection; |
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
public class DigestTest | |
{ | |
@Test | |
public void test() { | |
String sql = "SELECT count(ZDeviceLite.device_id) FROM device ZDeviceLite"; | |
// This variable is meaningless and only used for benchmarking, to prevent the | |
// JVM from optimizing away the loops below due to non-use of the returned types. | |
int hash = 0; |
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
package com.zaxxer.hikari.benchmark; | |
import com.zaxxer.hikari.HikariConfig; | |
import com.zaxxer.hikari.HikariDataSource; | |
import java.sql.*; | |
import java.util.concurrent.ThreadLocalRandom; | |
/** | |
* docker run --name some-mysql -e MYSQL_USER=brettw -e MYSQL_PASSWORD=secret -e MYSQL_DATABASE=issue1118 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 -d mysql:5.5 |
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
package com.zaxxer.jna; | |
import com.sun.jna.JNIEnv; | |
import com.sun.jna.Library; | |
import com.sun.jna.Native; | |
import com.sun.jna.NativeLibrary; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.TreeMap; |
Interesting Kotlin/Java comparison ... this Java:
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter xmlWriter = factory.createXMLStreamWriter(writer);
xmlWriter.writeStartDocument();
xmlWriter.writeStartElement("html");
xmlWriter.writeStartElement("head");
xmlWriter.writeStartElement("title");
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/env perl | |
use feature qw(say); | |
our %smartctl_raw; | |
say '<html><body><pre style="font-size: smaller">'; | |
_build_smartctl(18); | |
_build_smartctl(34); |
OlderNewer