Skip to content

Instantly share code, notes, and snippets.

package main
import (
"sync"
"testing"
)
type MyStruct struct {
FirstName string
LastName string
@avneesh91
avneesh91 / pool.go
Last active November 30, 2023 17:23
type Pool interface{}
func (p *Pool) Get() any
type MyStruct struct {
FirstName string
LastName string
}
func NewMyStruct(firstName string, lastName string) MyStruct{
return MyStruct{
FirstName: firstName,
LastName: lastName
}
package repositories
import (
"context"
"fmt"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"log"
@avneesh91
avneesh91 / metrics_exporter.py
Created May 1, 2023 21:06
Prometheus Metrics Exporter
import os
from prometheus_client import start_http_server
from prometheus_client import Histogram, Summary, Counter
from app_io.constants import PROMETHEUS_PORT
class MetricType:
SUMMARY='SUMMARY'
HISTOGRAM='HISTOGRAM'
COUNTER='COUNTER'
audio_processor_config:
feat_language_identification: False
# defaults to hi-IN
language: ''
# path of the files on gcs which need to be processed
remote_raw_audio_file_path: ''
snr_done_folder_path: ''
@avneesh91
avneesh91 / gist:86065c466982dd7c0ed7648e52103695
Created July 16, 2020 08:51
For generating kubectl file from gcloud
this article -> https://gravitational.com/blog/kubectl-gke/
Installation
sudo apt-get install uuid
install cfssl, this article => https://www.pimwiddershoven.nl/entry/install-cfssl-and-cfssljson-cloudflare-kpi-toolkit
then this script => https://raw.githubusercontent.com/gravitational/teleport/master/examples/gke-auth/get-kubeconfig.sh
'''
Script for picking up changes from the change stream
'''
import os
import json
import pymongo
from bson.json_util import dumps
from bson import ObjectId
client = pymongo.MongoClient('mongodb://localhost:27017/')
'''
Script for picking up changes from the change stream
'''
import os
import json
import pymongo
from bson.json_util import dumps
from bson import ObjectId
client = pymongo.MongoClient('mongodb://localhost:27017/')
{
'$children': [
{
'$children': [Array],
'$text': 'Grapeville, PA, United States',
'$name': 'location'
},
{
'$children': [Array],
'$text': 'Flatbed Truck Driver',