$ cat catall
for i in $(ls -rt1 `find -type f`);
do
# type file name in red color
echo -e "\033[31;1m$i\033[0m"
cat $i;
done;
This script won't work for files with whitespaces within their names
$ cat catall
for i in $(ls -rt1 `find -type f`);
do
# type file name in red color
echo -e "\033[31;1m$i\033[0m"
cat $i;
done;
<ul id="menu">
<li class="goog-menuitem goog-option" id="item1">Item 1</li>
<li class="goog-menuitem goog-option" id="item2">Item 2</li>
<li class="goog-menuitem goog-option" id="item3">Item 3</li>
</ul>
var menu = new goog.ui.Menu();
menu.decorate(goog.dom.getElement('menu'));
goog-option
class makes menu items selectable. When a user clicks on an any element, the clicked element will get goog-option-selected
style.
goog.events.listen(menu, goog.ui.Component.EventType.ACTION, function(e) {
/** @type {string} */
var text = goog.dom.getTextContent(e.target.getElement());
menu.forEachChild(function(c) {
if (c != e.target) {
c.setSelected(false);
c.setChecked(false);
}
});
caption.getElement().innerHTML = text;
} );
#!/bin/sh
function showHelp() {
echo "
Usage:
$0 MAIN_JS_FILE [MODE];
MAIN_JS_FILE - A JavaScript file to compile.
MODE - If set to \"debug\" will omit compilation step and produce human readable script. This mode will not perform any checks on your JS code
Examples:
Compile in debug mode:
./compile.sh js/test.js debug
Compile with javascript checks and optimizations:
./compile.sh js/test.js
";
}
test -z "$1" && echo "MAIN_JS_FILE is required" && showHelp && exit 1;
test -f "$1" || echo "MAIN_JS_FILE is not a file" && showHelp && exit 1;
export dir=..
export compiler=$dir/compiler.jar
export closureLibraryHome=$dir/closure-library/closure
export calcdeps=$closureLibraryHome/bin/calcdeps.py
export target=./www/compiled.js
export mode="compiled"
test "$2" == "debug" && export mode="script"
echo running in $dir in $mode mode
python $calcdeps -i "$1" -p "js" -p "$closureLibraryHome" -o $mode --output_file="www/compiled.js" -c "$compiler" -f "--js_output_file" -f "$target" -f "--compilation_level" -f "ADVANCED_OPTIMIZATIONS" -f "--warning_level" -f "VERBOSE"
EOF