Skip to content

Instantly share code, notes, and snippets.

View kostyay's full-sized avatar

Kostya Ostrovsky kostyay

View GitHub Profile
@kostyay
kostyay / service-account-admin-sdk.go
Last active November 29, 2022 15:52
[Golang] Use google admin sdk from service account impersonating as user #adminsdk
// 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"
)
@kostyay
kostyay / sublime_close_without_saving.py
Created January 9, 2023 09:44
Sublime 3 Close All Windows without saving
# 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
@kostyay
kostyay / Caddyfile
Created April 16, 2024 20:47
Rails app with Postgres and Caddy on Hetzner VPS with Docker Compose
{
email my@email.com
}
my.host.com {
encode zstd gzip
log {
output stdout
}