View partition.ts
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
/** | |
* Partition an array into two arrays based on a predicate. | |
* | |
* @param array | |
* @param isValid | |
*/ | |
export function partition<T, V>( array: ( T | V )[], isValid: ( x: T | V ) => x is T ): [ T[], V[] ] { | |
return array.reduce( ( [ pass, fail ], elem ) => { | |
return isValid( elem ) ? [ [ ...pass, elem ], fail ] : [ pass, [ ...fail, elem ] ]; | |
}, [ [] as T[], [] as V[] ] ); |
View docker-compose.yaml
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
services: | |
rabbitmq: | |
image: "rabbitmq:${RABBITMQ_VERSION:-3-management}" | |
hostname: "rabbitmq-{{.Node.Hostname}}" | |
networks: | |
- rabbitmq | |
expose: | |
- 5672 # AMQP | |
- 15672 # Web UI | |
- 15692 # Metrics |
View stripe-schema.json
This file has been truncated, but you can view the full file.
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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"definitions": { | |
"Stripe.Account": { | |
"description": "The Account object.", | |
"properties": { | |
"business_profile": { | |
"$ref": "#/definitions/Stripe.Account.BusinessProfile", | |
"description": "Business information about the account." | |
}, |
View validators.ts
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
/** | |
* Validates a value that isn't falsy. | |
* | |
* @param field | |
* @param message | |
*/ | |
export function required( | |
field?: string, | |
message?: string | Message<string>, | |
): Validator { |
View App.vue
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
<template> | |
<div v-dragging="{ enter, leave }"> | |
</div> | |
</template> | |
<script> | |
import './dragging.ts'; | |
export default { | |
methods: { |
View www.conf
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
[www] | |
user = www-data | |
group = www-data | |
listen = 127.0.0.1:9000 | |
listen.backlog = 511 | |
;listen.allowed_clients = 127.0.0.1 | |
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user or group is differrent than the master process user. |
View cloudflare_update_certificate.sh
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
#!/usr/bin/env php | |
<?php | |
// This should be the main domain your certificate is valid for. It's used for reverse | |
// matching the installed certificate and resolving the file path to your certificate | |
// files on the local file system. | |
$domain = 'your.domain.name.tld'; | |
// This should be your Cloudflare zone ID. You can find it in the right sidebar on your | |
// Cloudflaare account dashboard. |
View Cloudflare.js
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
'use strict'; | |
const axios = require('axios'); | |
class Cloudflare { | |
constructor ( zone, emailAddress, apiKey ) { | |
this._zone = zone; | |
this._emailAddress = emailAddress; | |
this._apiKey = apiKey; |
View OutputInterceptor.php
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
<?php | |
/** | |
* Intercepts bytes written to an output stream and redirects them into a buffer instead | |
*/ | |
class OutputInterceptor extends php_user_filter | |
{ | |
/** | |
* Holds the PHP stream filter | |
*/ |
View TemplateEditor.vue
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
<template> | |
<article class="template-editor"> | |
<header> | |
<h2 class="editor-heading">Twig Template editor</h2> | |
</header> | |
<section class="variable-editor"> | |
<header> | |
<h3 class="variables-heading"> | |
Variables | |
<span class="variable-count">{{ Object.keys(this.variables).length }}</span> |
NewerOlder