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
String.prototype.format = function() { | |
var args = arguments; | |
return this.replace(/{(\d+)}/g, function(match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match | |
; | |
}); | |
}; |
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 | |
# Cygwin is special | |
if [ -z "${OSTYPE}" ]; then | |
case $(uname) in | |
"CYGWIN*") export OSTYPE='CYGWIN' ;; | |
'Darwin') export OSTYPE='Darwin' ;; | |
'Linux') export OSTYPE='Linux' ;; | |
esac | |
fi |
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 | |
brew_command=/usr/local/bin/brew | |
brew_cask_command="$brew_command cask" | |
echo '#!/bin/bash' | |
echo '' | |
echo 'trap ctrl_c INT' | |
echo 'function ctrl_c() {' | |
echo 'echo "** Trapped CTRL-C"' |
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
function plus_equals --no-scope-shadowing | |
set -l __fish_value $$argv[1] | |
set $argv[1] (math $__fish_value + $argv[2]) | |
end |
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 boot | |
;; Format files using cljfmt (https://github.com/weavejester/cljfmt) | |
(set-env! :dependencies '[[cljfmt "0.5.2"]]) | |
(require '[cljfmt.core :as fmt] | |
'[clojure.java.io :as io]) | |
(def help-text | |
"cljfmt: Format files using cljfmt (https://github.com/weavejester/cljfmt) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ulexpd:doPublish | |
xmlns:ulex="http://ulex.gov/ulex/2.0" | |
xmlns:ulexpd="http://ulex.gov/publishdiscover/2.0" | |
xmlns:ulexcodes="http://ulex.gov/codes/2.0" | |
xmlns:ulexlib="http://ulex.gov/library/2.0" | |
xmlns:j="http://niem.gov/niem/domains/jxdm/4.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
(ns testing | |
(:require [clj-xpath.core :as xp])) | |
(def ^:dynamic xml-doc | |
(slurp "xml-test.xml")) | |
(xp/with-namespace-context (xp/xmlnsmap-from-root-node xml-doc) | |
(xp/$x "//Person" xml-doc)) | |
(xp/with-namespace-context (xp/xmlnsmap-from-root-node xml-doc) |
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
(ns testing | |
(:require [clj-xpath.core :as xp])) | |
(def ^:dynamic xml-doc | |
(slurp "xmlns-test.xml") | |
(xp/with-namespace-context (xp/xmlnsmap-from-root-node xml-doc) | |
(xp/$x "//lexsdigest:Person" xml-doc)) | |
(xp/with-namespace-context (xp/xmlnsmap-from-root-node xml-doc) |
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 python3 | |
""" | |
Generate random passwords. Mainly useful for copying and pasting | |
into password managers | |
""" | |
import argparse, random, string, sys, unicodedata, re |
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
pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; } | |
.string { color: green; } | |
.number { color: darkorange; } | |
.boolean { color: blue; } | |
.null { color: magenta; } | |
.key { color: red; } |