Skip to content

Instantly share code, notes, and snippets.

@marshallbrekka
marshallbrekka / pyproject.toml
Created March 25, 2022 02:28
Poetry Install Updates
[tool.poetry]
name = "test-poetry-package"
version = "0.1.0"
description = ""
authors = ["Marshall Brekka <marshallsmedia@gmail.com>"]
[tool.poetry.dependencies]
python = "^3.9"
requests = "*"
@marshallbrekka
marshallbrekka / greeter_client.py
Created May 10, 2017 17:24
greeter_client.py
from __future__ import print_function
import grpc
import time
import helloworld_pb2
import helloworld_pb2_grpc
def run():
channel = grpc.insecure_channel('localhost:50051')
@marshallbrekka
marshallbrekka / greeter_client.rb
Created May 10, 2017 17:24
greeter_client.rb
this_dir = File.expand_path(File.dirname(__FILE__))
lib_dir = File.join(this_dir, 'lib')
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
require 'grpc'
require 'helloworld_services_pb'
def main
sleep(15)
stub = Helloworld::Greeter::Stub.new(ENV["GRPC_TARGET"] || 'localhost:50051', :this_channel_is_insecure)
I0510 17:07:44.327046349 17 ev_epoll_linux.c:95] epoll engine will be using signal: 40
D0510 17:07:44.327992917 17 ev_posix.c:107] Using polling engine: epoll
D0510 17:07:44.328776580 17 dns_resolver.c:316] Using native dns resolver
D0510 17:07:44.329694583 17 rb_channel.c:534] GRPC_RUBY: wait for channel polling thread to start
D0510 17:07:44.329779682 54 rb_channel.c:525] GRPC_RUBY: run_poll_channels_loop - create connection polling thread
D0510 17:07:44.331194890 54 rb_channel.c:489] GRPC_RUBY: run_poll_channels_loop_no_gil - begin
D0510 17:07:44.331788980 17 connectivity_state.c:98] CONWATCH: 0x55a97d70be38 client_channel: get IDLE
D0510 17:07:44.332221263 17 connectivity_state.c:98] CONWATCH: 0x55a97d70be38 client_channel: get IDLE
D0510 17:07:44.332596215 17 connectivity_state.c:135] CONWATCH: 0x55a97d70be38 client_channel: from IDLE [cur=IDLE] notify=0x55a97d7668b0
I0510 17:04:18.971631382 11 ev_epoll_linux.c:93] epoll engine will be using signal: 40
D0510 17:04:18.971677127 11 ev_posix.c:107] Using polling engine: epoll
### NOTE: First RPC issued
I0510 17:04:33.997872846 11 client_channel.c:1033] OP[client-channel:0x559feee87108]: [COVERED] SEND_INITIAL_METADATA{key=3a 70 61 74 68 ':path' value=2f 68 65 6c 6c 6f 77 6f 72 6c 64 2e 47 72 65 65 74 65 72 2f 53 61 79 48 65 6c 6c 6f '/helloworld.Greeter/SayHello', key=3a 61 75 74 68 6f 72 69 74 79 ':authority' value=6c 6f 63 61 6c 68 6f 73 74 3a 35 30 30 35 31 'localhost:50051', key=66 6f 6f 'foo' value=62 61 72 'bar', key=67 72 70 63 2d 61 63 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 'grpc-accept-encoding' value=69 64 65 6e 74 69 74 79 2c 64 65 66 6c 61 74 65 2c 67 7a 69 70 'identity,deflate,gzip'} SEND_MESSAGE:flags=0x00000000:len=10 SEND_TRAILING_METADATA{} RECV_INITIAL_METADATA RECV_MESSAGE RECV_TRAILING_METADATA
D0510 17:04:33.998805232 47 connectivity_state.c:109] CONWATCH:
@marshallbrekka
marshallbrekka / python-grpc-1.3.0.log
Created May 10, 2017 17:19
python-grpcio-1.3.0-error
D0510 16:54:32.514515313 13 ev_posix.c:107] Using polling engine: poll
D0510 16:54:32.514565254 13 dns_resolver.c:316] Using native dns resolver
### NOTE: First RPC issued
I0510 16:54:47.539423892 13 client_channel.c:1229] OP[client-channel:0xb75de8]: [COVERED] SEND_INITIAL_METADATA{key=3a 70 61 74 68 ':path' value=2f 68 65 6c 6c 6f 77 6f 72 6c 64 2e 47 72 65 65 74 65 72 2f 53 61 79 48 65 6c 6c 6f '/helloworld.Greeter/SayHello', key=3a 61 75 74 68 6f 72 69 74 79 ':authority' value=6c 6f 63 61 6c 68 6f 73 74 3a 35 30 30 35 31 'localhost:50051', key=67 72 70 63 2d 61 63 63 65 70 74 2d 65 6e 63 6f 64 69 6e 67 'grpc-accept-encoding' value=69 64 65 6e 74 69 74 79 2c 64 65 66 6c 61 74 65 2c 67 7a 69 70 'identity,deflate,gzip'} SEND_MESSAGE:flags=0x00000000:len=5 SEND_TRAILING_METADATA{} RECV_INITIAL_METADATA RECV_MESSAGE RECV_TRAILING_METADATA
D0510 16:54:47.540472938 18 connectivity_state.c:110] CONWATCH: 0x7fee90001e00 (null): get IDLE
D0510 16:54:47.540524277
@marshallbrekka
marshallbrekka / cf-template.clj
Created November 28, 2013 01:54
CloudFormation Template Generation
(defn keys->strings
"Given a map converts all keys that are keywords from dash-separated to
camel-case using key->string."
[m]
(let [f (fn [[k v]] [(key->string k) v])
walk-fn (fn [x]
(if (map? x)
(->> (map f x)
(into {}))
x))]
// Sample data used when put into a mocking mode
var exampleAccounts = [{
id: 1,
balance: 2254.86,
name: "JetBlue Card Orig"
}];
var accounts = new PersistentSpec("accounts/1/accounts", {
seq : true,
(def input-schema {(optional-key :id) Number})
(def output-schema [{:id Number
:balance Number
:name String}])
(defvalidatedfn get-accounts [params]
[input-schema => output-schema]
(i/get-accounts params))
var loginForm = [{
"key" : "LOGIN",
"label" : "Username",
"optional": false,
"type" : "text",
"values": null,
"max-length": 16,
"size": 20,
"provider-type": "single",
"help-text": null