Skip to content

Instantly share code, notes, and snippets.

View bekwam's full-sized avatar

Bekwam, Inc bekwam

View GitHub Profile
@bekwam
bekwam / gist:929820314ada4cc9df6db8ef4cdb7e98
Created October 22, 2022 14:58
Docker Piping Logs to JQ for Flat Format
docker container logs es | jq -r '"\(.["@timestamp"]) \(.["log.level"]) \(.message)"'
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_DHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
@bekwam
bekwam / reduceExample.js
Created July 20, 2021 13:30
JS Reduce Example
const starting = [
{
potentialUpgrades: ["D-a","D-b","D-c"],
productName: "D",
registeredUser: "test4.example.com"
},
{
potentialUpgrades: ["E-a","E-b","E-c"],
productName: "E",
registeredUser: "test4.example.com"
@bekwam
bekwam / .vue
Created July 2, 2020 12:57
Add Bulma To App.vue
<style lang="scss">
@import "bulma/bulma.sass";
</style>
public class ByteBufferTest {
public static void main(String[] args) {
byte[] a = new byte[2];
a[0] = (byte)0xff;
a[1] = (byte)0xcc;
ByteBuffer byteBuffer = ByteBuffer.allocate(2);
@bekwam
bekwam / gist:62b5a3087666a3ead5dcac15cc69dcd3
Created January 5, 2019 13:31
Maven Java 8 Source Settings
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
@bekwam
bekwam / web.xml
Created January 2, 2019 15:43
WildFly 15 Empty web.xml File
<?xml version="1.0"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
</web-app>
@bekwam
bekwam / FetchResultsSerializer.java
Created December 30, 2018 16:32
Stream-Only Custom Gson
import com.google.gson.*;
import org.apache.commons.lang3.tuple.Pair;
import java.lang.reflect.Type;
import java.util.List;
import java.util.stream.Collector;
//
// Converts a List of Pair<String, Long> into a JSON array of objects where the key of the Pair is
// field name "url" and the value is "fileSize"
@bekwam
bekwam / ClassWithSurrogateKey.kt
Created August 16, 2018 11:16
Kotlin Class With Surrogate Key Field
data class ClassWithSurrogateKey(val field1 : String, val field2 : Int) {
val id = nextId() // always increasing
companion object {
private var idgen = 1 // faux static class member
fun nextId() = idgen++
}
}
@bekwam
bekwam / FullScreenApp.java
Created February 7, 2017 22:07
A JavaFX App That Takes Up the Whole Screen (Primary)
public class FullScreenApp extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
VBox vbox = new VBox(new Label("Hello, World!"));
vbox.setAlignment(Pos.TOP_CENTER); // 0, auto
Scene scene = new Scene( vbox );