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
# Base image for | |
FROM node:16 as dependencies_base | |
ARG NPM_TOKEN | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm config set @aaberg:registry https://gitlab.com/api/v4/packages/npm/ | |
RUN npm config set -- '//gitlab.com/api/v4/packages/npm/:_authToken' "${NPM_TOKEN}" |
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
public class KeyValueList <E, V> extends AbstractList<Map.Entry<E, V>> { | |
private final Table data; | |
private final Class classOfE; | |
private final Class classOfV; | |
public KeyValueList(Table data, Class<E> classOfE, Class<V> classOfV) { | |
this.data = data; | |
// It is necessary to specify the class of the key and value, | |
// as it is not possible to get this information from java generics. |
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
try (Connection connection = sql2o.open()) { | |
connection.createQuery("truncate table mytable").executeUpdate(); | |
} |
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
Sql2o sql2o = new Sql2o(url, user, pass); | |
// Get generated key from SERIAL column | |
@Test | |
public void testKeyKeyOnSerial() { | |
String createTableSql = "create table test_serial_table (id serial primary key, val varchar(20))"; | |
sql2o.createQuery(createTableSql).executeUpdate(); | |
String insertSql = "insert into test_serial_table(val) values ('something')"; |
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
@SuppressWarnings("serial") | |
public static final Map<String, String> identifiers = new HashMap<String, String>() { | |
{ | |
put("google", "https://www.google.com/accounts/o8/id"); | |
} | |
}; | |
public static Result auth() { | |
Logger.debug("authenticate"); | |
String providerId = "google"; |