Skip to content

Instantly share code, notes, and snippets.

View lucperkins's full-sized avatar
🎯
Focusing

Luc Perkins lucperkins

🎯
Focusing
View GitHub Profile
const {GetTodoRequest} = require(‘./todos_pb.js’);
const {TodoServiceClient} = require(‘./todos_grpc_web_pb.js’);
const todoService = new proto.todos.TodoServiceClient(‘http://localhost:8080’);
const todoId = 1234;
var getTodoRequest = new proto.todos.GetTodoRequest();
protoc echo.proto \
--js_out=import_style=commonjs:./output \
--grpc-web_out=import_style=commonjs:./output
@lucperkins
lucperkins / # coredns - 2019-01-31_09-32-03.txt
Created February 1, 2019 20:41
coredns on macOS 10.14.2 - Homebrew build logs
Homebrew build logs for coredns on macOS 10.14.2
Build date: 2019-01-31 09:32:03
@lucperkins
lucperkins / ci.rego
Created June 6, 2019 18:10
Open Policy Agent CI example
package ci
# The package.json is presumed faulty
default allow = false
# Packages that aren't allowed
blacklist = {
"event-stream",
"left-pad"
}
@lucperkins
lucperkins / package.json
Created June 6, 2019 18:57
Failing package.json
{
"private": true,
"dependencies": {
"event-stream": "^4.0.1",
"express": "^4.17.1",
"left-pad": "^1.3.0"
}
}
@lucperkins
lucperkins / main.workflow
Last active June 18, 2019 17:17
Open Policy Agent CI example (GitHub Actions workflow)
workflow "OPA evaluation" {
on = "push"
resolves = ["install"]
}
# Determines whether the policy has been violated
action "evaluate" {
uses = "docker://openpolicyagent/opa:0.11.0"
args = [
"eval",
# Install doctl (DigitalOcean CLI tool)
brew install doctl
# Install kubectl
brew install kubernetes-cli
# Log into DigitalOcean
export DO_ACCESS_TOKEN=...
doctl auth login init --access-token ${DO_ACCESS_TOKEN}
defmodule TasksAppWeb.TodoController do
use TasksAppWeb, :controller
use Plug.ErrorHandler
alias TasksApp.Todos
alias TasksApp.Todos.Todo
def index(conn, _params) do
todos = Todos.list_todos()
conn
@lucperkins
lucperkins / envoy-grpc-web-config.yaml
Created October 9, 2018 01:52
Envoy blog post Gists
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 8080 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
@lucperkins
lucperkins / warning.bash
Last active September 20, 2022 21:43
Blog post snippets
warning: Target and debugger are in different PID namespaces;
thread lists and other data are likely unreliable.
Connect to gdbserver inside the container.