Skip to content

Instantly share code, notes, and snippets.

@hikari-no-yume
Created May 25, 2019 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hikari-no-yume/6e053d686f2f9f719a52ea26d6c3e3d4 to your computer and use it in GitHub Desktop.
Save hikari-no-yume/6e053d686f2f9f719a52ea26d6c3e3d4 to your computer and use it in GitHub Desktop.
makes a directory listing
#!/usr/bin/env php
<?php declare(strict_types=1);
$glob = glob($argv[1] ?? "*");
echo "<!doctype html>";
echo "<meta charset=utf-8>";
echo "<body style=\"font-family: monospace;\">";
echo "<ul>";
foreach ($glob as $blob) {
echo "<li>";
echo "<a href=\"", $blob, "\">", $blob, "</a>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment