Skip to content

Instantly share code, notes, and snippets.

View bmonkman's full-sized avatar

Bill Monkman bmonkman

View GitHub Profile
@bmonkman
bmonkman / echoserver-ingress.yaml
Created April 23, 2021 00:35
NLB Testing Configuration
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: echoserver
annotations:
# nginx ingress
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /$1
# cert-manager
ingress.kubernetes.io/ssl-redirect: "true"
@bmonkman
bmonkman / resolver.go
Created June 14, 2020 17:54
resolver.go
package resolvers
import (
"context"
"github.com/commitdev/myapp/internal/database"
"github.com/commitdev/myapp"
)
func (r *queryResolver) User(ctx context.Context, id string) (*models.User, error) {
@bmonkman
bmonkman / schema.graphql
Created June 14, 2020 17:53
schemal.graphql
"""A date following the RFC3339 standard"""
scalar RFC3339Date
"""A date without time information"""
scalar Date
"""Cursor-based pagination helper"""
type PageInfo {
startCursor: String
@bmonkman
bmonkman / gqlgen.yml
Created June 14, 2020 17:52
gqlgen.yml
# Schema Definition
schema: schema/*.graphql
exec:
filename: generated/server/server.go
package: server
model:
filename: generated/gqlmodels/gqlmodels.go
package: gqlmodels
@bmonkman
bmonkman / stupid_at_channels.txt
Last active March 15, 2018 00:23
#stupid_at_channels
bryce [2:45 PM]
joined #stupid_at_channels.
bryce [2:45 PM]
@channel hey all
@channel hey does anyone know how to use email
@channel got a client on the phone, can someone please explain what bench does
@channel thanks everyone
bryce [2:47 PM]
@bmonkman
bmonkman / tdd.sh
Created November 21, 2017 21:12
Go TDD
#!/usr/bin/env bash
PATTERN="${1}"
if [ "${PATTERN}" == "" ]; then
PATTERN="*"
fi
DIR=`pwd`
LAST_HASH=""

Keybase proof

I hereby claim:

  • I am bmonkman on github.
  • I am bmonkman (https://keybase.io/bmonkman) on keybase.
  • I have a public key ASCiwqJHGTp3gThjmMxwbMP6DU7Byn54T7Xi28uFFNCsfAo

To claim this, I am signing this object:

@bmonkman
bmonkman / PHPDarklaunchHandler.php
Last active August 29, 2015 14:10
PHP Dark Launch handler for Consul
#!/usr/local/bin/php
<?php
define('IN_DARKLAUNCH_CONFIG_DIR', '/some/path/');
// Type, e.g. 'core' supplied on the command line by the consul watch
$dlType = $argv[1];
// Get and decode stdin
$data = stream_get_contents(fopen('php://stdin', 'r'));
$consulKVData = json_decode($data, true);
@bmonkman
bmonkman / consul-watch.json
Last active August 29, 2015 14:10
Consul watch example
{
"watches": [
{
"type": "keyprefix",
"prefix": "darklaunch/dashboard/core/",
"handler": "/path/to/PHPDarklaunchHandler.php dashboard-core 2>>/var/log/consul_watch_output_dashboard_core"
}
]
}
<?php
define(COOKIE_FILE, "/var/tmp/sn-run");
define(GAME_NUMBER, "5566012476882944");
define(MY_ID, 5); // Player id
touch(COOKIE_FILE);
$allies = array(1,10); // Optional ally ids - disable notifications for these players if it gets too annoying.
$from = $to = "spacenorad@yourdomain.com"; // Notification address