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
fetch('http://www.marklogic.com') | |
.then(console.log); | |
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/bin/env bash | |
defaults write com.apple.screencapture type png | |
defaults write com.apple.screencapture location ~/Screenshots | |
killall SystemUIServer |
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
rsync -e 'ssh' -avlt --delete \ | |
--exclude 'Microsoft User Data' \ | |
--exclude '.parallels-vm-directory' \ | |
--exclude 'Personal' \ | |
--exclude '.DS_Store' \ | |
--exclude '.git/' \ | |
--exclude 'Virtual Machines.localized' \ | |
--exclude 'WebEx' \ | |
--exclude 'Web Receipts' \ | |
--exclude 'Workspaces' \ |
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' | |
const ctx = {modules: 0, root: '/modules/root/path'}; | |
const obj = fn.head( | |
//xdmp.invoke('main.sjs') | |
xdmp.invoke('main.sjs', ctx) | |
); | |
obj.say(); | |
// ==> "Bob says: Hi!"" |
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' | |
const json = { | |
"a": ["A", "A", {"b": "B"} ], | |
"c": { "d": "D", "e": ["E", "E"]}, | |
"f": "F" | |
} | |
function isPrimitive(obj) { | |
if(null === obj) return true; | |
if(undefined === obj) return true; |
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 module namespace sec="http://marklogic.com/xdmp/security" at "/MarkLogic/security.xqy"; | |
(: Don’t use this in production. It leaks security information available to a user with elevated privileges, such as admin. :) | |
try { | |
(: … :) | |
} catch($err) { | |
if('SEC-PERMDENIED' = $err/error:code/data()) then | |
xdmp:invoke-function( function() { | |
for $role in xdmp:user-roles(xdmp:get-current-user()) (: Or a specific user, especially if you’re running as an elevated role :) |
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
DotJoshJohnson.xml-1.7.0 | |
EditorConfig.EditorConfig-0.6.0 | |
EditorConfig.EditorConfig-0.6.2 | |
alefragnani.Bookmarks-0.12.0 | |
dbaeumer.vscode-eslint-1.2.7 | |
donjayamanne.python-0.5.9 | |
donjayamanne.python-0.6.0 | |
dracula-theme.theme-dracula-1.8.0 | |
eg2.vscode-npm-script-0.1.8 | |
esbenp.prettier-vscode-0.10.1 |
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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Date viewer</title> | |
<style type="text/css"> | |
body { font-family: Helvetica; font-size: 14pt; } | |
table { | |
border: solid 1px #ccc; | |
border-spacing: 0; |
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
# Python 2.7 | |
import requests | |
session = requests.Session() | |
response = session.post('https://developer.marklogic.com/login', data={'email': '[email protected]', 'password': '********'}) | |
# > 200 OK | |
# > {"status":"ok","name":"Justin Makeig"} | |
response = session.post('https://developer.marklogic.com/get-download-url', data={'download': '/download/binaries/8.0/MarkLogic-8.0-5.5-x86_64.dmg'}) | |
# > 200 OK | |
# > {"status":"ok","path":"/download/binaries/8.0/MarkLogic-8.0-5.5-x86_64.dmg?t=*************/&email=whoami%40example.com"} | |
path = response.json().get('path') |
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'; | |
/** | |
* Default implementation. Specialized classes should | |
* extend and override/extend on their own prototypes. | |
*/ | |
function Wrapper(wrapped) { | |
// Factory, not direct constructor | |
if(!this) { return new Wrapper(wrapped); } | |
// Internal (not private) property to track the wrapped object |