Skip to content

Instantly share code, notes, and snippets.

@floatingatoll
floatingatoll / seconds_to_human_time.bash
Created December 3, 2013 01:48
Usage: result=$( seconds_to_human_time $SECONDS )
seconds_to_human_time () {
local result= sign= suffix= seconds=
# Precisely one argument.
if [[ ${#@} != 1 ]] || [[ -z $1 ]]; then
echo 'Usage: result=$( seconds_to_human_time $SECONDS )' 1>&2
exit 1
fi
# Record whether it's positive or negative, choosing the right suffix.
HTTP/1.1 500 Backend Servers Unavailable
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Service Unavailable</title>
<style type="text/css">
body, p, h1 {
#!/usr/bin/python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#