Skip to content

Instantly share code, notes, and snippets.

View SirPhemmiey's full-sized avatar
🎯
Focusing

Oluwafemi Akinde SirPhemmiey

🎯
Focusing
View GitHub Profile
@SirPhemmiey
SirPhemmiey / main.go
Last active June 6, 2024 00:54
Circuit breaker with exponential backoff
package main
import (
"fmt"
"math"
"math/rand"
"net/http"
"time"
"github.com/sony/gobreaker"
@SirPhemmiey
SirPhemmiey / main.go
Last active June 7, 2024 23:07
Implementing a circuit breaker pattern with advanced strategies in go
package main
import (
"fmt"
"math"
"math/rand"
"net/http"
"time"
"github.com/prometheus/client_golang/prometheus"
@SirPhemmiey
SirPhemmiey / main.go
Created May 25, 2024 16:02
Implementing a circuit breaker pattern (with prometheus) in go
package main
import (
"fmt"
"net/http"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sony/gobreaker"
@SirPhemmiey
SirPhemmiey / main.go
Last active May 25, 2024 15:36
Implementing a basic circuit breaker pattern in go
package main
import (
"fmt"
"net/http"
"time"
"github.com/sony/gobreaker"
)
@SirPhemmiey
SirPhemmiey / full_redis_playbook.yml
Created May 1, 2023 21:37
Full Ansible Playbook for Redis configuration
---
- name: Redis Installation
hosts: redis
become: true
tasks:
- name: Update package repositories
yum:
update_cache: yes
@SirPhemmiey
SirPhemmiey / full_vm_provision.yml
Created May 1, 2023 21:12
Full ansible playbook version to provision vm instance and allowing remote access to redis
- import_playbook: requirements.yml #you can find the file content in my gist
- name: Provision a GCP VM
hosts: localhost
gather_facts: false
vars:
gcp_cred_file: <your json service account>
gcp_project: <project-id>
machine_type: "e2-medium"
---
- hosts: localhost
connection: local
gather_facts: false
vars:
pip_package_requirements:
- "requests"
- "google-auth"
- "google-auth-httplib2"
---
- name: Redis Installation
hosts: redis
become: true
tasks:
- name: Update package repositories
yum:
update_cache: yes
@SirPhemmiey
SirPhemmiey / playbook.yml
Last active April 30, 2023 18:27
Basic Ansible code to create a VM instance on GCP
- import_playbook: requirements.yml
- name: Provision a GCP VM
hosts: localhost
gather_facts: false
vars:
gcp_cred_file: <path/to/serviceaccount/json/file>
gcp_project: <project-id>
machine_type: "e2-medium"
@SirPhemmiey
SirPhemmiey / typescript.json
Created February 7, 2021 09:11
Typescript.json
{
"Log info": {
"prefix": ["loginfo", "logger"],
"body": ["getLogger().info(${1:info})"],
"description": "Log info"
},
"Log error": {
"prefix": ["logerror"],
"body": ["getLogger().error(${1:error})"],
"description": "Log error"