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 April 10, 2025 21:54
Installing tomcat-native / libtcnative
VER=1.3.1
wget "http://www-eu.apache.org/dist/tomcat/tomcat-connectors/native/$VER/source/tomcat-native-$VER-src.tar.gz"
tar xzf tomcat-native-$VER-src.tar.gz
cd tomcat-native-$VER-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/"