Skip to content

Instantly share code, notes, and snippets.

View baxtheman's full-sized avatar

Daniele Baggio baxtheman

View GitHub Profile
@baxtheman
baxtheman / TestNativeQueryToListJson.java
Created October 20, 2017 14:25
Java JPA Native Query using Tuple and return List of Jackson JSON Object
/*
Needs Hibernate 5.2.11.Final
*/
public List<ObjectNode> getQuery(
Integer anno,
Integer settimana) {
Query q = em.createNativeQuery(
"NATIVE SQL....",Tuple.class);
@baxtheman
baxtheman / map.js
Created February 1, 2017 08:37
Google Map dark theme
map = new google.maps.Map(document.getElementById('gmaps'), {
zoom: 5,
center: {
lat: 43,
lng: 12
},
mapTypeId: google.maps.MapTypeId.ROADMAP,
styles: [{
"stylers": [{
"hue": "#ff1a00"
@baxtheman
baxtheman / gradle.settings
Created December 27, 2016 17:05
by Andrea Di Giorgi
configurations {
embeddedLibs
compileOnly.extendsFrom embeddedLibs
}
dependencies {
embeddedLibs group: 'org.hibernate', name: 'hibernate-core', version: '5.2.5.Final'
}
{
"Client_ID": "571358931HB160700000",
"rad_Name": "Bathroom downstaris"
}
@baxtheman
baxtheman / alarms.json
Created September 28, 2016 07:37
api/alarm/all/domain/0
{"result":[{"AlarmInfos":"prov:default:/tag:Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA:/alm:Consumo Scarso Refrigerazione Acqua","Cleared":0,"AlarmDate":"2016-09-27T18:47:31.000Z","Priority":1,"Val":"1","tag":"Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA"},{"AlarmInfos":"prov:default:/tag:Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA:/alm:Consumo Scarso Refrigerazione Acqua","Cleared":0,"AlarmDate":"2016-09-26T18:46:52.000Z","Priority":1,"Val":"1","tag":"Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA"},{"AlarmInfos":"prov:default:/tag:Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA:/alm:Consumo Scarso Refrigerazione Acqua","Cleared":0,"AlarmDate":"2016-09-23T18:46:52.000Z","Priority":1,"Val":"1","tag":"Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA"},{"AlarmInfos":"prov:default:/tag:Caseificio Tonon/Sede Caseificio/TZeroTonon_MET05PA:/alm:Consumo Scarso Refrigerazione Acqua","Cleared":0,"AlarmDate":"2016-09-22T18:46:51.000Z","Priority":1,"Val":"1","tag":"Caseificio Tonon/Se
standard: [5002,5006],
msgCanVar: [2001,2003]
@baxtheman
baxtheman / conditionsJSON
Last active June 13, 2016 13:36
MachineDatalogTrigger
{
"onCond": [
{
"varId": 43,
"oper": "",
"value": [
3
],
"cond": "=",
"varType": "CAN_L2"
public static void notifyError(final Throwable e) {
try {
if (Validator.isNull(PortletPropsValues.WEBHOOK_LOG_URL)) {
return;
}
final StringBuilder sb = new StringBuilder();
@JsonIgnoreProperties(ignoreUnknown=true,value={ "expandoBridge", "expandoBridgeAttributes","cachedModel","escapedModel","modelAttributes","modelClass","modelClassName","new","primaryKey","primaryKeyObj" })
public class ResponseImpl extends ResponseBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this class directly. All methods that expect a response model instance should use the {@link it.sysdata.intouch.broker.model.Response} interface instead.
*/
public ResponseImpl() {
}
}
@baxtheman
baxtheman / ADT, use taglib
Created February 25, 2015 12:52
liferay, freemarker tips
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
<@liferay_ui["asset-categories-summary"]
groupId="${themeDisplay.getScopeGroupId()}"
articleId="${cur_webContentId.getData()}"/>