Skip to content

Instantly share code, notes, and snippets.

View kofiasare's full-sized avatar
🎯
Focusing

Kofi Asare kofiasare

🎯
Focusing
View GitHub Profile
@kofiasare
kofiasare / .env
Last active April 17, 2024 13:58
Phoenix with docker compose
PGHOST=db
PGUSER=postgres
PGPASSWORD=postgres
PGDATABASE=hello_dev
PGPORT=5432
@kofiasare
kofiasare / redis_rate_store.rb
Created March 2, 2022 13:36
The following example implements a Redis store to save exchange rates to a redis database.
class RedisRateStore
INDEX_KEY_SEPARATOR = '_TO_'.freeze
# Using second db of the redis instance
# because sidekiq uses the first db
REDIS_DATABASE = 1
# Using Hash to store rates data
REDIS_STORE_KEY = 'rates'
@kofiasare
kofiasare / search.rb
Last active February 22, 2022 01:09
Meilisearch: Search multiple indexes using graphql and parallel gems with Rails
module Queries
class Search < BaseQuery
include SearchHelper
type [Types::SearchResultsType], null: true
argument :query, String, required: true
argument :models, [String], required: true, default_value: ['AppUser']
def resolve(**args)
search(args)
@kofiasare
kofiasare / makefile
Created October 6, 2018 17:25 — forked from sohlich/makefile
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@kofiasare
kofiasare / spec.go
Created December 29, 2016 11:46 — forked from karlseguin/spec.go
A simple test helper for Go. See http://openmymind.net/Testing-In-Go/
package tests
import (
"testing"
)
type S struct {
t *testing.T
}