Skip to content

Instantly share code, notes, and snippets.

View slugmandrew's full-sized avatar
⚛️
React, ahoy!

Drew Spencer slugmandrew

⚛️
React, ahoy!
View GitHub Profile
@slugmandrew
slugmandrew / EncryptionTest.scala
Last active March 31, 2020 14:33
Scala and Java encryption using javax.crypto
package com.efstech.pdm.blobstorage.upload
import com.efstech.pdm.blobstorage.encryption.FileEncrypterDecrypter
import com.efstech.pdm.common.util.UsesLogger
import javax.crypto.{Cipher, KeyGenerator}
import org.testng.Assert
import org.testng.annotations.Test
class EncryptionTest extends UsesLogger {
@slugmandrew
slugmandrew / Damn you generators!
Last active July 27, 2017 11:27
Trying to get classes in target\generated\annotations visible to gwt compiler - pretty sure they're not
"C:\Program Files\Java\jdk1.8.0_131\bin\java" -Dvisualvm.id=1264888459135663 -Dmaven.multiModuleProjectDirectory=C:\Users\Drew\IntelliJ\energybox "-Dmaven.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\lib\idea_rt.jar=50376:C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2017.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.1.5 -DskipTests=true install -P dev,staging,!live
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent
[INFO] shared
[INFO] server
[INFO] client
[INFO] EnergyBox
@slugmandrew
slugmandrew / SuperTable.java
Last active June 9, 2017 12:09
Custom Widget of CellTable, dataprovider, pager etc with ability to hide/show columns
package com.utilitiessavings.usavappv7.client.application.us;
import com.allen_sauer.gwt.log.client.Log;
import com.google.common.collect.Maps;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.cellview.client.Column;
1. Go here: https://console.aws.amazon.com/ec2sp/v1/spot/home?region=us-east-1
2. Click: "Request Spot Instances"
3. Request type: "Request and Maintain"
4. Choose how ever many servers/vcpus you want in the "Target Capacity" section.
5. In "AMI" search for "docker". Pick any one of the results.
@slugmandrew
slugmandrew / [app] pom.xml
Last active January 19, 2020 09:00
Multi-module maven setup for GWT 2.8.0-RC1 (that breaks Super Dev Mode)
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.utilitiessavings.usavapp</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
@slugmandrew
slugmandrew / CellListStyle.css
Created November 24, 2015 18:57
GWT Custom CellList Resources
.cellListSelectedItem {
background: #f2f2f2;
color: inherit;
}
.cellListKeyboardSelectedItem {
background: #f2f2f2;
color: inherit;
}
@slugmandrew
slugmandrew / BaseDao.java
Last active August 29, 2015 14:09
Objectify setup for BaseDao<T>
package com.utilitiessavings.usavappv7.server.dao;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.inject.Inject;
@slugmandrew
slugmandrew / pom.xml
Last active December 23, 2015 20:09
POM from GWTP + AppEngine + Objectify archetype Revision 2 shows plugins merged into pluginManagement causing annotations to not be processed correctly
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.utilitiessavings.usavapp</groupId>
<artifactId>UsavAppV7</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>GWTP AppEngine Objectify</name>
@slugmandrew
slugmandrew / AbstractAsyncCallback.java
Last active December 23, 2015 12:59
Creating a global RPC system for GWTP
public interface AbstractAsyncCallback<T> extends AsyncCallback<T>
{
// this method is not implemented in AsyncCallbackImpl, but in each presenter separately
void onReturn(T result);
}
@slugmandrew
slugmandrew / AdminModule.java
Created August 21, 2013 14:13
AdminModule and Presenter/View/UiBinder triplet
public class AdminModule extends AbstractPresenterModule
{
@Override
protected void configure()
{
bindPresenter(AdminPresenter.class, AdminPresenter.MyView.class, AdminView.class, AdminPresenter.MyProxy.class);
}
}