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
# RTD-X model for our example blog post | |
name: Blog Post | |
description: RTD-X sample Blog Post | |
# which resource types are accepted in a POST | |
# to this resource to create child resources | |
post-here: | |
- rtdx/samples/2018/blog/folder | |
- rtdx/samples/2018/blog/imagefolder |
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
#!/bin/bash | |
# Script that signs an input file with all keys of a given Apache PMC | |
# Example use: | |
# | |
# ./encrypt.sh https://people.apache.org/keys/group/sling.asc somefile.txt | |
# | |
# To list which keys a file has been encrypted for, use | |
# | |
# gpg --list-only --no-default-keyring --secret-keyring /dev/null <filename> |
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
diff --git a/docker-compose/Makefile b/docker-compose/Makefile | |
index 1f9ca78..600a8b5 100644 | |
--- a/docker-compose/Makefile | |
+++ b/docker-compose/Makefile | |
@@ -3,6 +3,7 @@ DOCKER_REGISTRY ?= "" | |
DOCKER_IMAGE_PREFIX ?= openwhisk | |
PROJECT_HOME ?= ./openwhisk-master | |
WSK_CLI ?= $(PROJECT_HOME)/bin/wsk | |
+JAVA_OPTS ?= "" | |
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 groovy.xml.MarkupBuilder | |
/* Simple Groovy DSL example | |
* slightly adapted from https://dzone.com/articles/groovy-dsl-simple-example | |
*/ | |
class DslTest extends GroovyTestCase { | |
void testDslUsage_outputText() { | |
def memo = MemoDsl.make { | |
to "Nirav Assar" |
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
<% | |
/* Demonstrate Sling Query in server-side Javascript */ | |
var $ = Packages.org.apache.sling.query.SlingQuery.$ | |
var SearchStrategy = Packages.org.apache.sling.query.api.SearchStrategy | |
var resourceResolver = resource.getResourceResolver() | |
var result = { | |
siblings : $(resource).siblings(), | |
rootChildren : $(resource).parents().last().children(), | |
queryResult : $(resourceResolver) | |
.searchStrategy(SearchStrategy.QUERY) |
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
<html> | |
<head> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script> | |
<script>hljs.initHighlightingOnLoad();</script> | |
</head> | |
<body> | |
<h1>Some Java</h1> | |
<pre><code> | |
public class Result implements Iterable <ResultLog.Entry> { |
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
// Demonstrate how to inject Groovy expressions | |
// in a plain Java string | |
def now = "${new Date()}" | |
def data = [ value : "The date is ${now}" ] | |
// Inject Groovy variables from inputData | |
// into the supplied string | |
def interpolate(inputData, str) { | |
// TODO is there a way to have another name than "x" | |
// for the injected variable? |
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
#!/usr/sbin/dtrace -s | |
/* dump all "open" syscalls */ | |
/* $1 is the PID to observe */ | |
syscall::open:entry | |
/pid == $1/ | |
{ | |
printf("'%s' (PID: %d): syscall:open %s", execname, pid, copyinstr(arg0)); | |
} |
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 lamdbastuff; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.Semaphore; |
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 main | |
// I'm a total beginner in Go, please have mercy ;-) | |
// Reads a JSON input object with an "url" field that points to an image file | |
// Uses exiftool to extract file metadata | |
// Outputs a JSON document with that metadata + request information | |
import ( | |
"bufio" | |
"encoding/json" |