Skip to content

Instantly share code, notes, and snippets.

View rcosnita's full-sized avatar

Radu Viorel Cosnita rcosnita

  • CICD SOFTWARE SYSTEMS
  • Bucharest, Romania
View GitHub Profile
@rcosnita
rcosnita / jenkins.yaml
Created November 28, 2019 12:43
Jenkins operator k8s definition
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: jenkins.jenkins.io
spec:
group: jenkins.io
names:
kind: Jenkins
listKind: JenkinsList
@rcosnita
rcosnita / gist:92728f72e8d27d7c3451748a66ff4453
Last active November 19, 2020 16:57
Delete all resources from k8s
#!/usr/bin/env bash
# # this gist is extracted from another gist on internet which I don't remember right now.
# kubectl-delete_all is a utility to delete all objects in the namespace.
[[ -n "$DEBUG" ]] && set -x
set -eou pipefail
exec kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all "$@"
@rcosnita
rcosnita / main.go
Created July 11, 2023 08:02
Provide a simple example for using golang generics for simulating strong type API http clients.
package main
import "fmt"
type Versionable interface {
Version() string
}
type Neg10_0_1 struct {
Attr10_1_0 string
@rcosnita
rcosnita / externalemailprovider.cpp
Created January 12, 2024 13:24
Sample code excellently explained by Jetbrains AI Assistant: externalemailprovider
// Provides the interface for plugging in a new external email provider.
export class ExternalEmailProvider {
public:
// Provides the contract for sending an email through the external email
// provider.
virtual auto sendEmail(Email&& email) -> async::NoneAsync = 0;
// Provides the contract for diagnosing the external email provider.
virtual auto diagnose(
proto::EmailProviderDiagnosisActionType_Enum action,
@rcosnita
rcosnita / sequencing.go
Created March 8, 2024 05:05
Golang sequencing with context cancellation
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
)