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
{ | |
email [email protected] | |
} | |
my.host.com { | |
encode zstd gzip | |
log { | |
output stdout | |
} |
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
# This will close all views (files open in specific window) without asking to save them | |
# You can register it to a keyboard shorcut using this snippet | |
# {"keys": ["ctrl+shift+q"], "command": "close_without_saving"} | |
import sublime | |
import sublime_plugin | |
class CloseWithoutSaving(sublime_plugin.WindowCommand): | |
def run(self): | |
window = self.window |
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
// It took me few hours how to get this to work | |
// Have a service account in GCP which wanted to use Admin SDK with Google Workspace | |
// The service account needs to have the following role: `roles/iam.serviceAccountTokenCreator` | |
// You need to create a domain wide delegation for the service account client id | |
import ( | |
"google.golang.org/api/impersonate" | |
"google.golang.org/api/option" | |
"context" | |
) |
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
/BTS7960 motor driver sketch | |
int R_IS = 1; | |
int R_EN = 2; | |
int R_PWM = 3; | |
int L_IS = 4; | |
int L_EN = 5; | |
int L_PWM = 6; | |
void setup() { |
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
admin: | |
access_log_path: /dev/stdout | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } | |
static_resources: | |
listeners: | |
- name: listener_0 | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 8080 } |
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
// Import the client and the message definition | |
import { TimeServiceClient } from '../jsclient/time/v1/time_service_grpc_web_pb'; | |
import { GetCurrentTimeRequest } from '../jsclient/time/v1/time_service_pb'; | |
// Connect to the gprc-web server | |
const client = new TimeServiceClient("http://localhost:8080", null, null); | |
// This is a neat chrome extension that allows you to spy on grpc-web traffic just like you would on normal traffic. | |
// You can find it here: https://chrome.google.com/webstore/detail/grpc-web-developer-tools/ddamlpimmiapbcopeoifjfmoabdbfbjj?hl=en | |
const enableDevTools = window.__GRPCWEB_DEVTOOLS__ || (() => {}); | |
enableDevTools([ |
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
package main | |
import ( | |
"context" | |
"log" | |
"net" | |
"time" | |
pb "github.com/kostyay/grpc-web-example/time/goclient/time/v1" | |
"google.golang.org/grpc" |
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
syntax = "proto3"; | |
package smpl.time.api.v1; | |
option go_package = "github.com/kostyay/grpc-web-example/api/time/v1"; | |
message GetCurrentTimeRequest { | |
} | |
message GetCurrentTimeResponse { |
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
proto_outdir = "./protodep" | |
[[dependencies]] | |
target = "github.com/mwitkow/go-proto-validators" | |
branch = "master" | |
path = "github.com/mwitkow/go-proto-validators" | |
ignores = ["./test", "./examples"] | |
[[dependencies]] | |
target = "github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api" |
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
{ | |
"excludes": [ | |
"protodep", | |
"js" | |
], | |
"protoc": { | |
"version": "3.11.4", | |
"includes": [ | |
"/project", |
NewerOlder