Skip to content

Instantly share code, notes, and snippets.

View prince-neres's full-sized avatar
🔥

Prince prince-neres

🔥
View GitHub Profile
select l.plid, concat('/web', g.friendlyurl, l.friendlyurl)
from journalarticle ja
inner join assetentry ae on ae.classpk = ja.resourceprimkey
inner join portletpreferencevalue ppv on (
(ppv.largevalue like '%' || ae.classuuid || '%')
or
(ppv.name = 'assetEntryId' and (ppv.smallvalue = ae.entryid::TEXT or ppv.largevalue = ae.entryid::TEXT))
or
(ppv.name = 'articleId' and (ppv.smallvalue::TEXT = ja.articleid or ppv.largevalue = ja.articleid))
@prince-neres
prince-neres / index.html
Created November 27, 2024 16:37
Disable show password icon in browser autocomplete
<style>
#_com_liferay_login_web_portlet_LoginPortlet_password:-webkit-autofill {
animation: autofill-detect 0.001s both;
}
@keyframes autofill-detect {
from {
background-color: #fff;
}
to {
@prince-neres
prince-neres / jvm-debug-args.yaml
Last active July 22, 2025 02:21
JVM debug args in docker
- LIFERAY_JVM_OPTS=-Xms8g -Xmx8g -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
@prince-neres
prince-neres / ddm-template.ftl
Created November 9, 2024 00:28
Useful macro to use in fragments and templates
<#macro button configuration>
<div class="po-custom-btn">
<#if configuration.type=="action">
<button
class="btn btn-${configuration.buttonSize} btn-${configuration.buttonType}"
data-lfr-editable-id="action"
data-lfr-editable-type="action"
>
Go Somewhere
</button>
@prince-neres
prince-neres / configuration.json
Last active July 22, 2025 02:21
Liferay card fragment
{
"fieldSets": [
{
"fields": [
{
"name": "horizontalCard",
"label": "Card Horizonal",
"type": "checkbox",
"defaultValue": true
},
@prince-neres
prince-neres / portal-ext.properties
Created November 6, 2024 18:09
Properties to use ngrok with Liferay
captcha.enforce.disabled=true
virtual.hosts.valid.hosts=*
# Change domains
virtual.hosts.valid.hosts=9954-2804-2b28-4a0-455-7a8c-6dc-7e5e-e0.ngrok-free.app,www.9954-2804-2b28-4a0-455-7a8c-6dc-7e5e-e0.ngrok-free.app
web.server.https.port=443
web.server.protocol=https
# Change domains
@prince-neres
prince-neres / .env
Created September 17, 2024 18:39
liferay-with-loadbalancer-docker-compose
POSTGRES_USER=liferay_user
POSTGRES_PASSWORD=liferay_password
POSTGRES_DB=liferay_db
@prince-neres
prince-neres / index.ftl
Last active July 22, 2025 02:23
Get contents with resourceLocator
<div class="administrative-act">
[#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /]
[#assign currentUrl = themeDisplay.getURLCurrent() /]
[#attempt]
[#assign
actCategoryId = currentUrl?split("/")?last?number
actCategory = assetCategoryLocalService.getCategory(actCategoryId)
/]
[#recover]
@prince-neres
prince-neres / delete.ftl
Created May 18, 2024 20:58
Botão de bater ponto usando objects e fragmento
#assign
objectsEntriesIds = [526879,526881,526884,527547,527724,527730,527892,527894,527896,527898,527900,527905,527907,527909,527917,527919,527921,527923,527925,527927,527929,527931,527933,527935,527937,527939,527941,527943,527945,527947,527955,527960,527962,527966,527984,527986,527988,527990,527992,527994,527996,527998,528061,528092,528094,528247,528249,528251,528253,528255,528257,528277,529369,529477,529480,529482,529632,529634,529638,529640,529649,529651,529654,529657,529662,529671,529674,529676,529678,529680,529683,529685,529687,529689,529692,529705,529708,529710,529712,529714,529718,529720,529724,529726,529728,529758,529764,529766,529772,529774,529776,529778,529780,529782,529784,529786,529875,529877,529879,529881,529883,529885,529887,529889,529892,529894,529896,529898,529901,529903,529905,529907]
registroDePontosResource = resourceLocator.locate("/c/registrodepontos", "RegistroDePonto")
/>
<#list objectsEntriesIds as objectEntryId>
${registroDePontosResource.deleteObjectEntry(objectEntryId)}
</#
@prince-neres
prince-neres / configuration.json
Created May 14, 2024 12:59
Search contents fragment with headless API Liferay
{
"fieldSets": [
{
"fields": [
{
"name": "contentStructureId",
"label": "ID da estrutura do conteúdo",
"type": "text",
"dataType": "int",
"defaultValue": ""