Skip to content

Instantly share code, notes, and snippets.

@horelvis
horelvis / Importing JS
Created June 10, 2021 08:46 — forked from CesarCapillas/Importing JS
Alfresco Javascript Console Recipes
Import a script from the repository using a name-based path:
<import resource="/Company Home/Data Dictionary/Scripts/library.js">
Import a script from the repository using a NodeRef reference:
<import resource="workspace://SpacesStore/6f73de1b-d3b4-11db-80cb-112e6c2ea048">
Import a script from a Java classpath location:
@horelvis
horelvis / rule.js
Created September 17, 2020 18:13 — forked from vktr/rule.js
Add Stripe Customer Id to Auth0 via custom rule
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
if ('stripe_customer_id' in user.app_metadata) {
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id;
return callback(null, user, context);
}
var stripe = require('stripe')('sk_....');
var customer = {
@horelvis
horelvis / gist:09c81a1b7f5fdb24b625780fc3529364
Created July 28, 2020 07:02
Macos kill dock bug in float icons
killall Dock
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
@horelvis
horelvis / js
Created December 4, 2016 11:17
JS Liferay Global
var ControlMenu = Liferay.ControlMenu;
var Layout = Liferay.Layout;
var Portlet = Liferay.Portlet;
var Util = Liferay.Util;
@horelvis
horelvis / gist:89da43d2d8cbd5b4a928da8923503092
Created July 25, 2016 18:32
Docker stop and remove all
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@horelvis
horelvis / real-time-date-stamp.ftl
Created July 24, 2016 19:06 — forked from emiloberg/real-time-date-stamp.ftl
This is how you get a real date/time-stamp (such as article published date) in Freemarker in Liferay. With support for multilingual sites. When working with multilingual/non-English sites, date/time-stamp can be a bit of a headache as the date strings are strings with english words in them, such as Thu, 08 May 2014 11:48:00 +0000, rather than a …
<#-- ----------------------------------------------------------------- ->
-
- GETTING REAL TIME/DATE-STAMP
-
- When we ask Liferay for the create date of an article (or really we
- ask Liferay for the 'display-date' which is settable by the user) we get
- a string looking like this: 'Thu, 08 May 2014 11:48:00 +0000'. This
- string will always be in english and when we want to create a datetime
- object from it, we need to parse it with english locale.
-
@horelvis
horelvis / Free Memory RAM Linux
Last active October 5, 2015 22:05
Liberar memoria RAM en Linux
watch -n 1 free -m
sudo sync && sudo sysctl -w vm.drop_caches=3