Skip to content

Instantly share code, notes, and snippets.

View timnashcouk's full-sized avatar

Tim Nash timnashcouk

View GitHub Profile
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.

Your First Block

To make things simple, we're going to make a semi-structured way to display a mailing address.

We're going to start with a file tree that looks like this:

address-block
  ├ blocks
  | ├ address.jsx
<?php
namespace Sstalle\php7cc;
use PhpParser\PrettyPrinter\Standard as StandardPrettyPrinter;
use Sstalle\php7cc\CompatibilityViolation\CheckMetadata;
use Sstalle\php7cc\CompatibilityViolation\ContextInterface;
use Sstalle\php7cc\CompatibilityViolation\Message;
class CLIResultPrinter implements ResultPrinterInterface
@kouk
kouk / Example health-check script with systemd socket activation
Last active March 13, 2023 16:42
Simple HTTP health-check by abusing systemd socket activation with shell scripts
$ curl --dump-header - localhost:12345
HTTP/1.0 404 Not Found
Content-Type: text/html
Content-Length: 43
Date: Fri, 05 Dec 2014 17:48:56 +0000
<html>
<body>
<h1>WUT</h1>
</html>