Skip to content

Instantly share code, notes, and snippets.

View kooba's full-sized avatar
👍
shipping

Jakub Borys kooba

👍
shipping
View GitHub Profile
@kooba
kooba / nameko-grpc-examples-2.proto
Created February 28, 2019 09:22
Protobuf Service Definition
syntax = "proto3";
package products;
service products {
rpc get_product(GetProduct) returns (Product);
}
message Product {
int32 id = 1;
import json
from nameko.web.handlers import http
from nameko_grpc.dependency_provider import GrpcProxy
from products.products_pb2 import GetProduct
from products.products_pb2_grpc import productsStub
class ClientService:
@kooba
kooba / resizeImage.ts
Last active November 17, 2023 10:17
Resize image after upload to Firebase Storage bucket. Maintain access token of original image.
import * as admin from "firebase-admin";
import * as functions from "firebase-functions";
import * as fs from "fs";
import sharp from "sharp";
export const resizeImage = functions.storage
.object()
.onFinalize(async (object) => {
const bucket = admin.storage().bucket(object.bucket);
const filePath = object.name;