This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A D port of the Nim program: | |
* https://gist.github.com/jzakiya/6c7e1868bd749a6b1add62e3e3b2341e | |
* | |
* Related code, papers, and tutorials, are available here: | |
* https://www.scribd.com/doc/228155369/The-Segmented-Sieve-of-Zakiya-SSoZ | |
* https://www.scribd.com/document/266461408/Primes-Utils-Handbook | |
*/ | |
module twinprimes_ssoz; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vibe.vibe; | |
//// | |
// Example controller making use of the custom UDAs 'responseBody' and 'requestBodyParam'. | |
//// | |
/// Interface useful for generating client code with RestInterfaceClient. | |
@path("/api") | |
interface ApiRestInterface { | |
@safe: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright 2002-2020 the original author or authors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A local rate-limit following the example at: | |
# https://github.com/envoyproxy/envoy/tree/main/examples/local_ratelimit | |
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address | |
- address: | |
# This address is for a network socket, with an IP and a port. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address | |
- address: | |
# This address is for a network socket, with an IP and a port. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address | |
- address: | |
# This address is for a network socket, with an IP and a port. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address | |
- address: | |
# This address is for a network socket, with an IP and a port. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Resources loaded at boot, rather than dynamically via APIs. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources | |
static_resources: | |
# A listener wraps an address to bind to and filters to run on messages on that address. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener | |
listeners: | |
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses. | |
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address | |
- address: | |
# This address is for a network socket, with an IP and a port. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Runs versioned database SQL migrations on a Postgres database, running them in order and only | |
# once. | |
# Mostly compatible with Flyway: https://documentation.red-gate.com/fd/migrations-184127470.html | |
function usage() { | |
echo "Usage: $0 [options] | |
Searches for database migration files in './migrations/' with names in the form |