Skip to content

Instantly share code, notes, and snippets.

View kgolebiowski's full-sized avatar

Krzysztof Gołębiowski kgolebiowski

View GitHub Profile
@kgolebiowski
kgolebiowski / matomo.js
Created August 27, 2021 08:44
Liferay 7.0 Piwik/Matomo integration
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//example.com/";
_paq.push(['setTrackerUrl', u + 'piwik.php']);
_paq.push(['setSiteId', '1']);
@kgolebiowski
kgolebiowski / portal-log4j-ext.xml
Created January 16, 2016 23:56
Improved Liferay logging for Liferay 6.2 (copy together with log4j.dtd to liferay-portal-6.2-ce-ga5/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/META-INF/)
<?xml version="1.0"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
<rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
<param name="FileNamePattern" value="@liferay.home@/logs/[email protected]@.%d{yyyy-MM-dd}.log" />
</rollingPolicy>
<layout class="org.apache.log4j.EnhancedPatternLayout">
@kgolebiowski
kgolebiowski / logging.properties
Last active February 25, 2018 10:46
Improved Tomcat logging for Liferay 6.2 (copy to liferay-portal-6.2-ce-ga5/tomcat-7.0.62/conf/logging.properties)
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
package scripts.ddl
import com.liferay.portal.kernel.dao.orm.QueryUtil
import com.liferay.portal.kernel.search.*
import com.liferay.portal.kernel.util.GetterUtil
import com.liferay.portal.kernel.util.LocaleUtil
import com.liferay.portal.service.GroupLocalServiceUtil
import com.liferay.portal.util.PortalUtil
import com.liferay.portlet.dynamicdatalists.model.DDLRecord
import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalServiceUtil