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
#!/usr/bin/env bash | |
set -Eeufo pipefail | |
# ec2-proxy-command | |
# ================== | |
# | |
# Use this script with the ssh ProxyCommand option to automatically | |
# start an EC2 instance and then connect to its public DNS name. | |
# | |
# For example, consider the following stanza in ~/.ssh/config: |
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 org.shawnz; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class TruncatedInputStream extends InputStream { | |
private final long maxLength; | |
private final InputStream underlying; |
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 org.shawnz; | |
import java.io.InputStream; | |
import java.util.Arrays; | |
public class ZeroInputStream extends InputStream { | |
private final long zeroes; | |
private long read; |
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 java.util.*; | |
public class LazyList<E> extends AbstractSequentialList<E> { | |
private final ArrayList<E> cache = new ArrayList<>(); | |
private final Iterator<E> iterator; | |
private final int size; | |
public LazyList() { | |
this.iterator = Collections.emptyIterator(); |
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
for (var i = 1; i <= 100; i++) { | |
var k = 810092048 >> (i - 1) % 15 * 2 & 3, | |
s = ""; | |
if (k & 1) s += "Fizz"; | |
if (k > 1) s += "Buzz"; | |
console.log(s || i); | |
} |
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
<displays> | |
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE"> | |
<name><![CDATA[FK References]]></name> | |
<description><![CDATA[]]> | |
</description> | |
<tooltip><![CDATA[]]> | |
</tooltip> | |
<drillclass><![CDATA[null]]></drillclass> | |
<query> | |
<sql> |
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 org.shawnz.util; | |
import java.util.NoSuchElementException; | |
import java.util.function.Function; | |
public abstract class Either<L, R> { | |
private Either() { | |
} |
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 org.shawnz; | |
import org.hibernate.boot.Metadata; | |
import org.hibernate.boot.model.naming.Identifier; | |
import org.hibernate.boot.model.relational.Sequence; | |
import org.hibernate.dialect.Dialect; | |
import org.hibernate.mapping.Column; | |
import org.hibernate.mapping.Selectable; | |
import org.hibernate.mapping.Table; | |
import org.hibernate.tool.schema.extract.spi.ColumnInformation; |