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 = {
/**
* 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 / 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.
-