Skip to content

Instantly share code, notes, and snippets.

View johnou's full-sized avatar

Johno Crawford johnou

View GitHub Profile
@johnou
johnou / upload_webgl_facebook.sh
Created January 24, 2020 09:37
Jenkins Facebook WebGL upload script
# Upload to Facebook
FACEBOOK_CLIENT_ID=xxxx
FACEBOOK_CLIENT_SECRET=xxxx
FACEBOOK_APP_ID=1234
cd $WORKSPACE/build
zip -r MyGame_WebGL.zip MyGame_WebGL
BUILD_DATE=$(date '+%Y-%m-%d %H:%M:%S')
set +x
/**
* Send message over WebSocket
*
* @param instanceId Instance ID
* @param bufferPtr Pointer to the message buffer
* @param length Length of the message in the buffer
*/
WebSocketSend: function(instanceId, bufferPtr, length) {
var instance = webSocketState.instances[instanceId];
@johnou
johnou / gist:eb296c297204c7316135ab7cfefaa09d
Created November 5, 2019 12:01
Dependency-Check report NPE
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project h4k-server: Can not process Dependency-Check report. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project h4k-server: Can not process Dependency-Check report.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThr
import cloud.orbit.concurrent.Task;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
/**
* @author Johno Crawford ([email protected])
*/
package io.atomix.storage.journal;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
Index: protocols/primary-backup/src/main/java/io/atomix/protocols/backup/protocol/RestoreRequest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- protocols/primary-backup/src/main/java/io/atomix/protocols/backup/protocol/RestoreRequest.java (revision b3b1a3d28536f477ef155e3a96ce0a750da5fbda)
+++ protocols/primary-backup/src/main/java/io/atomix/protocols/backup/protocol/RestoreRequest.java (revision )
@@ -15,6 +15,8 @@
*/
package io.atomix.protocols.backup.protocol;
@johnou
johnou / DocumentTreeTest
Created April 6, 2018 14:42
io.atomix.core.tree.impl.DocumentTreeTest#testNotifications
16:40:15.161 [Time-limited test] WARN i.a.m.impl.NettyMessagingService - Disabling TLS for intra-cluster messaging; Could not load cluster key store: ../config/atomix.jks (No such file or directory)
16:40:15.179 [atomix-data-3] TRACE i.a.p.backup.roles.PrimaryRole - PrimaryRole{data-partition-1}{role=PRIMARY} - Sending BackupRequest{primary=3, term=2, index=4, primitive=PrimitiveDescriptor{name=4062affa-d1cc-4833-b38c-ec508e705846, type=DOCUMENT_TREE, backups=2, replication=ASYNCHRONOUS}, operations=[ExecuteOperation{index=1, timestamp=1523025615128, session=5004, node=12, operation=PrimitiveOperation{id=DefaultOperationId{id=UPDATE, type=COMMAND}, value=byte[]{length=35, hash=-2058303996}}}, ExecuteOperation{index=2, timestamp=1523025615133, session=5004, node=12, operation=PrimitiveOperation{id=DefaultOperationId{id=UPDATE, type=COMMAND}, value=byte[]{length=39, hash=1197501253}}}, ExecuteOperation{index=3, timestamp=1523025615142, session=5004, node=12, operation=PrimitiveOperation{id=DefaultOperationId{i
import io.atomix.cluster.Node;
import io.atomix.core.Atomix;
import io.atomix.messaging.Endpoint;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.util.concurrent.CompletableFuture;
public class Bootstrap3 {
@johnou
johnou / Bootstrap.java
Created December 30, 2017 11:48
Atomix cluster test
import io.atomix.cluster.Node;
import io.atomix.core.Atomix;
import io.atomix.messaging.Endpoint;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.util.concurrent.CompletableFuture;
/**
/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software