Skip to content

Instantly share code, notes, and snippets.

View Semior001's full-sized avatar

Yelshat Duskaliyev Semior001

View GitHub Profile
id price name
0 12345 abacaba
0 12345 cabaaba
1 54321 wtf
// can you simplify this handler's logic? it seems to be overcomplex
package caldav
type propfindHandler struct {
pf *propfinder
logger *slog.Logger
fetchPeriod trn.Range
}
local nav = require("navigation")
local Bot = {
pos = { x = 0, y = 0, z = 0 },
facing = nav.DIRECTION.NORTH,
init = function(self, pos, direction)
self.pos = pos
self.facing = direction
end,
package misc
// Queue is an implementation of the list data structure,
// it is a FIFO (first in, first out) data structure over a slice.
type Queue[T any] struct {
l []T
idx int
end int
}
package misc
// Queue is an implementation of the list data structure,
// it is a FIFO (first in, first out) data structure over a slice.
type Queue[T any] struct {
l []T
idx int
}
// NewQueue returns a new Queue.
package exampleservice
import (
"context"
api "prototemporal/_example/simple/api"
"go.temporal.io/sdk/temporal"
"go.temporal.io/sdk/workflow"
)
type ExampleService struct {
package tmiddleware
import (
"context"
"fmt"
"go.temporal.io/sdk/client"
"go.temporal.io/sdk/interceptor"
"google.golang.org/grpc/metadata"
"github.com/cappuccinotm/prototemporal/tmiddleware/overengineered"
"regexp"
@Semior001
Semior001 / main.go
Created August 6, 2023 23:00
s3 removing bucket setup
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
"github.com/aws/aws-sdk-go/aws"
package bot
// Run starts service until context is dead.
func (b *Bot) Run(ctx context.Context) error {
if err := b.notifyAdmins(ctx, "bot started"); err != nil {
return fmt.Errorf("send start message to admins: %w", err)
}
wg := &sync.WaitGroup{}
wg.Add(b.Workers)
package _example
import (
"context"
_ "embed"
"fmt"
"regexp"
"strings"
"testing"
"time"