Skip to content

Instantly share code, notes, and snippets.

View getvictor's full-sized avatar

Victor Lyuboslavsky getvictor

View GitHub Profile
---
version: "2"
services:
mysql_master:
image: mysql:8.0
volumes:
- mysql-replica-main:/tmp
command:
[
"mysqld",
@getvictor
getvictor / calendar.go
Created March 5, 2024 21:39
Using domain-wide delegation with Google calendar events
package main
import (
"context"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
"google.golang.org/api/calendar/v3"
"google.golang.org/api/option"
"log"
"time"
on:
push:
branches:
- master
schedule:
- cron: "40 * * * *"
workflow_dispatch: # Manual
permissions:
contents: write
@getvictor
getvictor / fuzz_test.go
Last active May 15, 2024 13:41
Sample fuzz test for exploring fuzz testing functionality. Full article at https://victoronsoftware.com/posts/fuzz-testing-with-go/
package main
import (
"testing"
)
/// Sample fuzz test for exploring fuzz testing functionality.
func FuzzSample(f *testing.F) {
testcases := []struct {
Num uint8
package main
/*
According to Go guidelines at https://go.dev/wiki/CodeReviewComments#declaring-empty-slices
When declaring an empty slice, prefer
var t []string
over
@getvictor
getvictor / DockerAttachInputStream.java
Last active August 29, 2015 13:58
Java InputStream that handles Docker's attach stream
package com.victoreda.playground.services.exec;
import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
/**
* Reader for reading the attach stream from Docker.
* @author Victor Lyuboslavsky