View MemberOfGroupFromProperty.java
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 java.util.ArrayList; | |
p | |
import org.alfresco.web.evaluator.BaseEvaluator; | |
import org.alfresco.web.extensibility.SlingshotEvaluatorUtil; | |
import org.json.simple.JSONObject; | |
import org.springframework.extensions.surf.RequestContext; | |
import org.springframework.extensions.surf.support.ThreadLocalRequestContext; | |
public class MemberOfGroupFromProperty extends BaseEvaluator { | |
protected SlingshotEvaluatorUtil util = null; |
View jmeter-results.conf
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
input { | |
file { | |
path => [ "/Users/jpotts/Documents/code/es-test/results.csv"] | |
} | |
} | |
filter { | |
if ([message] =~ "responseCode") { | |
drop { } | |
} else { | |
csv { |
View InvokeSearchTemplate.java
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
Map<String, Object> params = new HashMap<String, Object>(); | |
params.put("search_term", "elasticsearch"); | |
params.put("since", "now-30d"); | |
Template template = new Template("tweets", ScriptService.ScriptType.FILE, MustacheScriptEngineService.NAME, null, params); | |
SearchRequestBuilder request = client.prepareSearch(INDEX).setTemplate(template); | |
SearchResponse response = request.execute().actionGet(); |
View addSecondaryType.java
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
List<Object> aspects = doc.getProperty("cmis:secondaryObjectTypeIds").getValues(); | |
if (!aspects.contains("P:cm:geographic")) { | |
aspects.add("P:cm:geographic"); | |
HashMap<String, Object> props = new HashMap<String, Object>(); | |
props.put("cmis:secondaryObjectTypeIds", aspects); | |
doc.updateProperties(props); | |
System.out.println("Added aspect"); | |
} else { | |
System.out.println("Doc already had aspect"); | |
} |
View example.sh
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
# Delete the example index | |
curl -XDELETE "http://localhost:9200/sortable-version-test?pretty=true" | |
# Create a new example index | |
curl -X POST "http://localhost:9200/sortable-version-test?pretty=true" | |
# Set the mapping. Assumes version.groovy resides in $ES_HOME/config/scripts | |
curl -XPOST "http://localhost:9200/sortable-version-test/version/_mapping?pretty=true" -d' | |
{ | |
"version": { |
View user.properties
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
jmeter.save.saveservice.output_format=csv | |
jmeter.save.saveservice.data_type=false | |
jmeter.save.saveservice.label=true | |
jmeter.save.saveservice.response_code=true | |
jmeter.save.saveservice.response_data.on_error=false | |
jmeter.save.saveservice.response_message=false | |
jmeter.save.saveservice.successful=true | |
jmeter.save.saveservice.thread_name=true | |
jmeter.save.saveservice.time=true | |
jmeter.save.saveservice.subresults=false |
View team_member.json
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
{ | |
"data": { | |
"type": "node--team_member", | |
"id": "d56fd5ed-65f8-4f31-b4c0-29f33ea67bfb", | |
"attributes": { | |
"nid": 16, | |
"uuid": "d56fd5ed-65f8-4f31-b4c0-29f33ea67bfb", | |
"vid": 17, | |
"langcode": "en", | |
"status": true, |
View headshot.json
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
{ | |
"data": { | |
"type": "file--file", | |
"id": "311f36ae-b233-4db9-84ba-803525307e42", | |
"attributes": { | |
"fid": 2, | |
"uuid": "311f36ae-b233-4db9-84ba-803525307e42", | |
"langcode": "en", | |
"filename": "gravatar.png", | |
"uri": "public://2018-03/gravatar.png", |
View fetch-blog-content.js
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
var Prismic = require('prismic.io').Prismic; | |
var testRepo = 'https://your-repo.prismic.io/api'; | |
Prismic.Api(testRepo, function(err, api) { | |
if (err) console.log(err); | |
api.form('blogPosts').ref(api.master()).submit(function(err, docs) { | |
if (err) console.log(err); | |
for (var i = 0; i < docs.results.length; i++) { |
View Reindexer.java
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
public class Reindexer extends BaseElasticsearchUtility { | |
private static Log logger = LogFactory.getLog(Reindexer.class); | |
public static void main(String[] args) { | |
if (args.length != 5) { | |
doUsage(); | |
System.exit(-1); | |
} |
NewerOlder