This file contains hidden or 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
'use strict'; | |
var crypto = require('crypto'); | |
// Lambda@Edge does not allow for environment variables so compare credential hash rather than store credentials in code | |
// sha256 hex digest of the Basic base64(username:password) header | |
// e.g. show below, generated on mac: | |
// echo -n "Basic `(echo -n 'admin:password' | openssl base64)`" | shasum -a 256 | |
const authStringSha256 = '9f19de0237c9bd59f803de1785f7aea4e3499b6929df3428e1b415fed81f797a'; |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<!-- ====================================================================== --> | |
<!-- P R O J E C T D E S C R I P T I O N --> | |
<!-- ====================================================================== --> | |
<groupId>uk.co.diffa.contentsync</groupId> | |
<artifactId>sync</artifactId> |
This file contains hidden or 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
env | grep "$TPL_PREFIX" | while read -r VAR; | |
do | |
REPLACE="s/`echo "$VAR" | sed -e s,=,/,`/" | |
sed -e "$REPLACE" "$SOURCE_FILE" > "$TARGET_FILENAME" | |
done |
This file contains hidden or 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 org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.api.wrappers.SlingHttpServletResponseWrapper; | |
import javax.servlet.Filter; | |
import javax.servlet.FilterChain; | |
import javax.servlet.FilterConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import javax.servlet.http.HttpServletResponse; |
This file contains hidden or 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 collections | |
import sys | |
Point = collections.namedtuple("Point",['x', 'y']) | |
Command = collections.namedtuple("Command", ['direction', 'magnitude']) | |
start_pos = Point(0,0) | |
map = [[]] | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
const host = 'http://localhost:4503'; | |
const rootPath = '/content/dam/mycompany'; | |
window.addEventListener("message", (event) => { | |
if (event.origin !== host) { |
This file contains hidden or 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 { stdin, stdout, exit } from 'node:process'; | |
import { parseArgs } from 'node:util'; | |
import { default as auth } from '@adobe/jwt-auth'; | |
import { default as fs } from 'fs'; | |
const options = { | |
'file': { type: 'string' }, | |
}; | |
const { values } = parseArgs({ options }); |
This file contains hidden or 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.chrisp.rde.core.servlets; | |
import org.apache.commons.lang3.StringUtils; | |
import org.apache.jackrabbit.api.binary.BinaryDownload; | |
import org.apache.jackrabbit.api.binary.BinaryDownloadOptions; | |
import org.apache.sling.api.SlingHttpServletRequest; | |
import org.apache.sling.api.SlingHttpServletResponse; | |
import org.apache.sling.api.resource.Resource; | |
import org.apache.sling.api.servlets.OptingServlet; | |
import org.apache.sling.api.servlets.SlingSafeMethodsServlet; |