Skip to content

Instantly share code, notes, and snippets.

View eedeebee's full-sized avatar

Eric Bloch eedeebee

  • Hillsborough, CA
View GitHub Profile
@eedeebee
eedeebee / create.php
Created March 26, 2013 18:23
MLPHP Sample Usage
<?php
$document = new Document($client);
$document->setContentFile('myfile.xml')->write('/myfile.xml');
?>
@eedeebee
eedeebee / get.js
Created March 26, 2013 18:18
MLDB Samples
var db = new mldb(); // default options
var doc = db.get("/messages/1", function(result) {
logger.debug("Doc content: " + JSON.stringify(result.doc));
});
@eedeebee
eedeebee / corona.js
Last active October 11, 2015 06:08
Search APIs
// TODO: transform for results
jQuery.ajax({
url: host + "/search",
username: "foo:bar",
type: "POST",
data: {
length: 10,
structuredQuery: {
and: [
@eedeebee
eedeebee / mlcp-example-1.sh
Last active September 20, 2016 08:11
MarkLogic Content Pump Examples
mlcp.sh import \
-host localhost \
-port 8006 \
-username user \
-password ******* \ 
-input_file_path /data/latest
@eedeebee
eedeebee / vis-widgets-1-.js
Created August 27, 2012 16:56
MarkLogic Visualization Widgets Snippets
$(document).ready(function() {
var config = {
searchEndpoint: "search.php",
valueEndpoint: "values.php"
}
ML.controller.init(config);
var options = {
constraint: "decade",
title: "Awards by decade",
@eedeebee
eedeebee / 4a-one-line-if-then-else.xqy
Created July 1, 2011 22:14
XQuery Coding Guidelines: Rule 4
(: one line if/then/else :)
if ($condition) then $action else ()
@eedeebee
eedeebee / sample-function-decl.xqy
Created July 1, 2011 22:01
XQuery Coding Guidlines: Rule 1
declare function my:function(
$a as xs:string,
$b as element(my:options)
) as empty-sequence()
{
(: body of function :)
};
<dev:lounge>
<beverages>
<coffee brew="strong" />
<soda flavor="orange"/>
</beverages>
<lab code="xquery" speed="awesome"/>
</dev:lounge>
@eedeebee
eedeebee / gist:779005
Created January 14, 2011 01:47
Snippet #4 from Adding Maps to an AppBuilder application
We couldn’t find that file to show.
@eedeebee
eedeebee / maps.js
Created January 14, 2011 01:45
Snippet #3 from Adding Maps to an AppBuilder application
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"),
myOptions);