Skip to content

Instantly share code, notes, and snippets.

@lyind
lyind / dcsl
Created September 22, 2017 10:01 — forked from sheershoff/dcsl
Docker-compose logs sorted by time
#!/bin/bash
usage="Input piped docker-compose logs -t, or a file created from this command, to show logs lines sorted by time.\n\n Usage:\n\n $(basename "$0") [-h|--help] - this message\n $(basename "$0") - runs default docker-compose logs -t and sorts'em\n docker-compose logs -t|$(basename "$0") - pipe logs to this command\n $(basename "$0") my-compose.log - or choose file with logs to display\n\n"
[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"
case "$1" in
-h|--help) printf "$usage"
exit
;;
esac
if [ -t 0 ]; then
docker-compose logs -t|sort -t "|" -k +2d
@lyind
lyind / saveAs.js
Last active September 11, 2017 22:23
// window.saveAs polyfill
// @author Andrew Dodson, Jonas Zeiger
// @copyright MIT, BSD. Free to clone, modify and distribute for commercial and personal use.
"use strict";
(function(window, document)
{
if (!window.saveAs)
{
var saveAs = undefined;