This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(['handlebars'], function (Handlebars) { | |
var templateHelpers = { | |
// Register all defined template helpers | |
load: function () { | |
// Render JSON representation of current context, | |
// e.g., {{{debug this}}} | |
Handlebars.registerHelper('debug', function (context) { | |
return new Handlebars.SafeString( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "path": "/content/geometrixx/my-first-jinja-page", | |
"properties": [ | |
{ "name": "jcr:primaryType", | |
"value": "cq:Page" }], | |
"nodes": [ | |
{ "path": "jcr:content", | |
"properties": [ | |
{ "name": "jcr:primaryType", | |
"value": "cq:PageContent"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
@headers = env.reject {|k, v| k =~ /async*|rack*/}.sort.each | |
haml :index | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httplib2 | |
import urllib | |
import base64 | |
from html2text import html2text | |
#---------------------------------------------------------- | |
# INSTANCE-SPECIFIC CONSTANTS // customize before running | |
CQ_HOSTNAME = 'localhost' | |
CQ_SERVER = 'http://%s:4502' % CQ_HOSTNAME | |
USERNAME = 'admin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codecs, os, glob | |
from datetime import datetime | |
import time | |
from stat import * | |
#---------------------------------------------------------- | |
BASE_DIR = r'C:\some_folder' | |
FILE_DIRS = [ | |
'some_subfolder_a', | |
'some_subfolder_b', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.my.company.customimporter; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import org.apache.sling.api.resource.Resource; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import com.day.cq.polling.importer.HttpImporter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "logger" | |
configure do | |
LOG = Logger.new(STDOUT) | |
LOG.level = Logger.const_get ENV['LOG_LEVEL'] || 'DEBUG' | |
LOG.info 'I am logging something.' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "sinatra" | |
require "json" | |
require "haml" | |
get '/' do | |
CURRENT_HOST = env['SERVER_NAME'] == 'localhost' ? "#{env['SERVER_NAME']}:#{env['SERVER_PORT']}" : env['SERVER_NAME'] | |
haml :home | |
end |