Skip to content

Instantly share code, notes, and snippets.

💭
Happily Coding!

Gary A. Stafford garystafford

💭
Happily Coding!
Block or report user

Report or block garystafford

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gimp_scale_batch.py
#!/usr/bin/python
# optimized for processing screen grabs
# copy and paste into GIMP Python Console
# open all images in Gimp to process
# script scales, sharpens, and exports all open images as PNGs
# Filters > Python-Fu > Console
import importlib
View compile_pbs.sh
# Generate gRPC stub (.pb.go)
protoc -I /usr/local/include -I. \
-I ${GOPATH}/src \
-I ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:. \
greeting.proto
# Generate reverse-proxy (.pb.gw.go)
protoc -I /usr/local/include -I. \
-I ${GOPATH}/src \
View greeting.pb.go
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: greeting.proto
package greeting
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
View greeting.proto
syntax = "proto3";
package greeting;
import "google/api/annotations.proto";
message Greeting {
string id = 1;
string service = 2;
string message = 3;
string created = 4;
View istio-gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: service-rev-proxy
spec:
hosts:
- api.dev.example-api.com
gateways:
- demo-gateway
http:
View main.go
// author: Gary A. Stafford
// site: https://programmaticponderings.com
// license: MIT License
// purpose: gRPC Gateway / Reverse Proxy
// reference: https://github.com/grpc-ecosystem/grpc-gateway
package main
import (
"context"
View main.go
// author: Gary A. Stafford
// site: https://programmaticponderings.com
// license: MIT License
// purpose: Service A - gRPC/Protobuf
package main
import (
"context"
"github.com/banzaicloud/logrus-runtime-formatter"
View main.go
// author: Gary A. Stafford
// site: https://programmaticponderings.com
// license: MIT License
// purpose: Service F
package main
import (
"bytes"
"context"
View main.go
// author: Gary A. Stafford
// site: https://programmaticponderings.com
// license: MIT License
// purpose: Service A
package main
import (
"encoding/json"
"github.com/banzaicloud/logrus-runtime-formatter"
View WeightedTextIndex.js
db.movieDetails.dropIndex('genres_text_title_text_plot_text')
db.movieDetails.createIndex({
title: 'text',
plot: 'text',
genres: 'text'
}, {
weights: {
genres: 4,
title: 2
You can’t perform that action at this time.