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
#!/usr/bin/env bash | |
# Need the max-time so it will actually retry in a reasonable amount of time | |
until curl -fsS \ | |
--max-time 1 \ | |
--digest --user admin:'********' \ | |
--head \ | |
http://localhost:8001/admin/v1/timestamp | |
do | |
sleep 2 |
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
~/Library/StartupItems/MarkLogic/MarkLogic stop; rm -rf ~/Library/Application\ Support/MarkLogic/Data; ~/Library/StartupItems/MarkLogic/MarkLogic start |
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
function tx(f, vars, opts) { | |
opts = opts || {}; | |
if(!opts.isolation) { opts.isolation = "different-transaction"; } | |
//opts.transactionMode = "update"; // Not sure what this does here. | |
return xdmp.eval('(' + f.toString() + ')();', vars, opts); | |
} | |
tx( | |
function() { | |
declareUpdate(); |
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
find . -name '.git' -type d -exec git --git-dir {} diff --exit-code \; |
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
# -f needs to be the last param or you'll get "Cannot stat: No such file of directory" | |
# --exclude-vcs doesn't work on OS X 10.9.5, thus --exclude=.svn | |
# * means all child files/directories, but not this one. This is useful for excluding "trunk". | |
tar --exclude=.svn -czvf ~/Desktop/archive.tar.gz * | |
# Verify the above worked | |
tar -tzvf ~/Desktop/archive.tar.gz | less |
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
Object.getOwnPropertyNames(Object.getPrototypeOf(obj)); |
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
#!/usr/bin/env bash | |
# From <http://linux.byexamples.com/archives/474/bash-script-that-process-input-from-pipeline-or-file-redirection/> | |
# If there is not param read from stdin else get from the input | |
# TODO: Get input from a specific parameter inline or from a file specified in a parameter. | |
if [ -e $1 ] ;then read str; else str=$1;fi | |
echo "$str" |
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
security find-internet-password -gs example.com 2>&1 | grep "password" | cut -d \" -f 2 |
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
function* asObjects(itr) { | |
for(var doc of itr) { | |
yield doc.toObject(); | |
} | |
} | |
var a = []; | |
for(var obj of asObjects(fn.collection())) { | |
a.push(obj.name = "Generated: " + obj.name); | |
} |
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
declareUpdate(); | |
// Hopefully this link doesn't go away. | |
var loc="https://doc-0s-1s-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/108nt093kbmcafeksihop0r1pcmkkvtr/1416031200000/14044389733472591834/*/0BwT5wj_P7BKXb2hfM3d2RHU1ckE?e=download"; | |
var qs=xdmp.documentGet(loc, {format: "json"}); | |
var shows = {}; | |
qs.next().value.toObject().forEach( | |
function(q) { | |
shows["" + q.show_number] = (shows["" + q.show_number]) ? shows["" + q.show_number] + 1 : 1; | |
var uri = "/" + q.show_number + "_" + shows["" + q.show_number] + ".json"; | |
// Has no one actually watched the show? |
OlderNewer