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 | |
cd $1 || exit 1 | |
to_json() { | |
ruby -ryaml -rjson -e 'YAML.load_stream(ARGF) do |doc| puts JSON.generate(doc) end' | |
} | |
(for override in .argocd-source*.yaml | |
do |
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
jlog() { | |
local FORMAT=${FORMAT:-'"\(.timestamp) \(.level)\t - \(.name) - \(.message)\t\t\(del(.timestamp, .message, .level, .name, .traceback))\(if .traceback then "\r\n\(.traceback | gsub("\n"; "\r\n"))" else "" end)\r"'} | |
tee >( grep --line-buffered -v "^{" > /dev/tty ) | grep --line-buffered "^{" | jq --raw-output --unbuffered "$FORMAT" | |
} | |
# USAGE: command that prints json logs | jlog |
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
/** | |
* Usage: | |
console.viz("digraph foo { a -> b; }"); | |
*/ | |
(function(global) { | |
"use strict"; | |
if (!global.console) { | |
return; | |
} |
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
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
.bar { | |
color: green; | |
} |
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
define(function(require) { | |
var compute = require("can/observe/compute/compute"); | |
/** | |
* Simple mixin that allows using CanJS Maps, Models and computes in React components. | |
* | |
* The render method becomes a compute. Any change calls forceUpdate. | |
* React will take the new virtual DOM and efficiently update the real DOM | |
* only if needed. | |
* |
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
/** | |
* Usage: | |
groovy webServer.groovy [-Pport=80] [-PwebRoot=/path/to/files] | |
* | |
* Or with gradle, place in src/main/groovy, and place assets in src/main/webapp | |
* and use as the mainClassName. | |
*/ | |
import com.sun.net.httpserver.* | |
// only supports basic web content types |
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
/** | |
* Shaper for cleaning up steal 3.2 declarations. Multiple calls are collapsed into a single | |
* wrapped call and non-dependant arguments are sorted. | |
*/ | |
if (typeof define !== 'function') { var define = require('amdefine')(module); } | |
define(['../shaper', '../fmt', '../ref', '../tkn'], function(Shaper, Fmt, Ref, tkn) { | |
"use strict"; "use restrict"; | |
new Shaper("steal-warn", function(root) { |
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
/** | |
* Shaper for cleaning up steal 3.2 declarations. Multiple calls are collapsed into a single | |
* wrapped call and non-dependant arguments are sorted. | |
*/ | |
if (typeof define !== 'function') { var define = require('amdefine')(module); } | |
define(['../shaper', '../fmt', '../ref', '../tkn'], function(Shaper, Fmt, Ref, tkn) { | |
"use strict"; "use restrict"; | |
var args = process.argv, |
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
TARGET_DIR="`pwd`/" | |
cd `dirname $0` | |
for f in $(cd "$TARGET_DIR" && git status | grep "\.js$" | cut -c14- | awk -v root="$TARGET_DIR" '{ print root $1 }') | |
do | |
node run-shaper.js "$f" plugins/quotes.js plugins/alpha.js --source > "$f".fixed | |
mv "$f"{.fixed,} | |
done |
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
/** | |
* Usage: | |
* 1. git clone git://github.com/olov/jsshaper.git | |
* 2. mv quotes.js plugins/ | |
* 3. node run-shaper.js TARGET_FILE plugins/quotes.js --source > CORRECTLY_QUOTED_FILE | |
*/ | |
if (typeof define !== 'function') { | |
var define = require('amdefine')(module); | |
} |
NewerOlder