Skip to content

Instantly share code, notes, and snippets.

View RF0's full-sized avatar

Rune Forberg RF0

  • Informed Individual
View GitHub Profile
@RF0
RF0 / Example usage in js controller
Created September 14, 2016 10:51
MyAppConfig.java - example for Enonic XP
const myAppConfig = __.newBean('com.enonic.myapp.MyAppConfig');
exports.get = function (req) {
const servicePrefix = `${myAppConfig.getProperty('services_prefix')}`;
const portalUrl = myAppConfig.getProperty('common_portalUrl');
@RF0
RF0 / gist:5467443
Created April 26, 2013 13:41
screenshotter-impress-script
function nextMainContentInterval() {

 setTimeout(function () {impressApi_mainContent.next(); nextMainContentInterval();}, 5000);

}
@RF0
RF0 / gist:5467031
Created April 26, 2013 12:17
screenshotter-heroku-login
$ heroku login
Enter your Heroku credentials.
Email: mr_enonic@example.com
Password:
Could not find an existing public key.
Would you like to generate one? [Yn]
Generating new SSH public key.
Uploading ssh public key /Users/mr_enonic/.ssh/id_rsa.pub
@RF0
RF0 / gist:5466969
Last active December 16, 2015 16:59
screenshotter-environment-variables-examples
Set config parameter locally and in Heroku
$>heroku config:add S3_BUCKET=screenshotter-bucket
$>heroku config:add S3_SECRET=39203jf23jf923ff32ijf
$>heroku config:add S3_KEY=239fjkfof3
Use config parameters in code:
AWS.config.update({accessKeyId: process.env.S3_KEY, secretAccessKey: process.env.S3_SECRET, region: process.env.S3_REGION});
var s3 = new AWS.S3();
web: node app.js
{
"name": "application-name"
, "version": "0.0.1"
, "private": true
, "engines": {
"node": ">= 0.0.1",
"npm": ">= 0.0.1"
}
, "dependencies": {
"express": ">= 3.x"
@RF0
RF0 / default-value-in-htmlarea-empty-v4-5-6
Created September 27, 2012 12:16
default value in htmlarea empty v4.5.6
<input config="custom" height="157" mode="xhtml" name="text-link" type="htmlarea" width="385">
<buttons>hyperlink,removeformat,history</buttons>
<display>Text link</display>
<xpath>contentdata/text-link</xpath>
<default>
<h2>Default value</h2>
</default>
<help>One text link without line breaks. Whole module is clickable with this link target.</help>
</input>
@RF0
RF0 / microdata-crisp-bread-example-aggregaterating
Created May 9, 2012 12:15
Microdata Crisp Bread Recipe Example AggregateRating
<div itemscope itemtype="http://schema.org/Recipe">
<span itemprop="name">Runes delicious crisp bread</span>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> stars -
based on <span itemprop="reviewCount">42</span> reviews
</div>
@RF0
RF0 / microdata-crisp-bread-example-ingredients
Created May 9, 2012 11:40
Microdata Crisp Bread Recipe Example Ingredients
<div itemscope itemtype="http://schema.org/Recipe">
<span itemprop="name">Runes delicious crisp bread</span>
Ingredients:
<ul>
<li itemprop="ingredients">water</li>
<li itemprop="ingredients">sesame seeds</li>
<li itemprop="ingredients">flax seed</li>
</ul>
</div>
@RF0
RF0 / microdata-crisp-bread-example-author
Created May 9, 2012 11:27
Microdata Crisp Bread Recipe Example Author
By <span itemprop="author">Rune Forberg</span>