Skip to content

Instantly share code, notes, and snippets.

View subomi's full-sized avatar
😝
What did you think you'd find here?

Subomi Oluwalana subomi

😝
What did you think you'd find here?
  • Convoy
  • Lagos, Nigeria
View GitHub Profile
@subomi
subomi / convoy-cla.md
Created March 20, 2023 20:02
Convoy CLA

Contributor License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”), and conveys certain license rights to Frain Technologies and its affiliates (“Frain”) for Your contributions to Frain’s open source projects. You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Frain’s open source projects.

1. Definitions

1.1. “You” or “Your” means any person or entity who exercises copyright or patent rights granted under this Agreement and who is making this Agreement with Frain. This also includes any person or entity controlled by the person or entity making this Agreement.
1.2. “Contribution” shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Frain for inclusion in, or documentation of, any of the products owned or managed by Frain (the "Project").
1.3. “Project” me

@subomi
subomi / twitter.go
Created July 7, 2022 12:40
Set up Twitter webhooks in Golang.
// Generate webhook URL.
package main
import (
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"time"
@subomi
subomi / migrate.go
Created January 31, 2022 10:19
Migrate to Convoy.
package main
import (
"context"
"database/sql"
"fmt"
"log"
"os"
convoy "github.com/frain-dev/convoy-go"
@subomi
subomi / convoy-dependencies.json
Last active February 28, 2022 21:39
Convoy Configuration Files
{
"environment": "development",
"multiple_tenants": true,
"database": {
"type": "mongodb",
"dsn": "<insert-mongodb-dsn>"
},
"queue": {
"type": "redis",
"redis": {
@subomi
subomi / paystack_webhook_validation.rb
Created January 24, 2021 18:53
Handle Paystack webhook validation in Ruby.
# Controller to handle Event.
class PaystackController < ApplicationController
skip_before_action :authorize_request, only: :webhook
def webhook
paystack_instance = PaystackObject.instance
valid_event = paystack_instance.verify_webhook_event?(request)
raise StandardError, 'Phony event - Not Paystack' unless valid_event
render status: 200, plain: "Ok\n"
@subomi
subomi / states-local-govt.json
Created May 23, 2020 18:32
Nigeria States & Local governements
{
"Abia State": [
"Aba South",
"Arochukwu",
"Bende",
"Ikwuano",
"Isiala Ngwa North",
"Isiala Ngwa South",
"Isuikwuato",
"Obi Ngwa",
# config/routes.rb
flipper_auth_app = Flipper::UI.app(Flipper.instance) do |builder|
builder.use Rack::Auth::Basic do |username, password|
if username == ENV['FLIPPER_USERNAME'] && password == ENV['FLIPPER_PASSWORD']
true
else
false
end
end
end
# app/utils/feature_flags.rb
module FeatureFlags
module Instrumentation
module_function
DEFAULT_ERROR_MESSAGE = 'This Feature is currently unavailable, please try again later.'
def before_query(query)
# We query for the root fields alone.
begin
# app/graphql/bitkoin_schema.rb
BitkoinSchema = GraphQL::Schema.define do
# ...
instrument(:query, FeatureFlags::Instrumentation)
# ...
end
@subomi
subomi / flipper.rb
Created February 4, 2019 08:37
configuring a global flipper instance
# config/initializers/flipper.rb
Flipper.configure do |config|
config.default do
adapter = Flipper::Adapters::ActiveRecord.new
Flipper.new(adapter)
end
end
# This setup is primarily for first deployment, because consequently
# we can add new features from the Web UI. However when the DB is changed/crashed