Skip to content

Instantly share code, notes, and snippets.

View Rob801130's full-sized avatar

Robo Rob801130

  • Svitavy
View GitHub Profile
Using a Consumer pattern vs. a constructor to populate an Enum instance. Handy if you
have a good number of fields and don't want long argument lists. Or if you need to do
some processing/method calling.
final fields would cause issues and would need to be done via a constructor without a callback.
public enum SomeEnum {
A((c)->{c.someField="A";}),
B((c)->{c.lotsMoreFields="B";}),
/*Syntax error
@trkaplan
trkaplan / huawei-device-user-agent-fringerprint-list.json
Created September 17, 2021 08:27
List of Huawei Smart Phone Devices (Tablets not included) User Agent Fingerprints Full List: https://github.com/arnaud-engineer/device-data-detector/blob/main/data.js
[
{
"name": "Huawei Y9s / P Smart Pro",
"series": "Y Series",
"userAgentFingerprint": "STK-L21",
"screenSize": 6.59,
"wRes": 1080,
"hRes": 2340
},
{
@pbkwee
pbkwee / installing-libtc-native.txt
Last active November 13, 2022 14:03
Installing tomcat-native / libtcnative
wget 'http://www-eu.apache.org/dist/tomcat/tomcat-connectors/native/1.2.14/source/tomcat-native-1.2.14-src.tar.gz'
tar xzf tomcat-native-1.2.14-src.tar.gz
cd tomcat-native-1.2.14-src/native
apt install libapr1-dev libssl-dev gcc make
./configure && make && make install
Add to /usr/local/tomcat/bin/setenv.sh:
export CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=$PATH:/usr/local/apr/lib/"
On a mac: brew install libtcnative. Then add to $tomcat/bin/setenv.sh CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=/usr/local/opt/tomcat-native/lib"