Skip to content

Instantly share code, notes, and snippets.

View ogtega's full-sized avatar
🍺
Building something

Teslim Olunlade ogtega

🍺
Building something
View GitHub Profile
@ogtega
ogtega / ComboBox.swift
Last active April 14, 2025 00:40
This Swift code builds a custom ComboBox (autocomplete/dropdown-like input) component in SwiftUI
import SwiftUI
struct ComboBox<Content, T>: View where Content: View, T: Hashable {
let hint: String
@Binding var text: String
@Binding var items: [T]
var filter: ((T) -> Bool)? = nil
var padding: EdgeInsets = EdgeInsets(
top: 0, leading: 0, bottom: 0, trailing: 0)
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.11.1/userguide/building_java_projects.html in the Gradle documentation.
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
@ogtega
ogtega / broker.py
Created August 2, 2022 09:59
A class that initializes a RabbitMQ broker interface
from typing import Any, Callable, Coroutine
import aio_pika
from aiormq.abc import ConfirmationFrameType
from aio_pika.abc import (
AbstractIncomingMessage,
AbstractConnection,
AbstractChannel,
@ogtega
ogtega / startup.py
Created August 2, 2022 06:40
A Python decorator to start an application regardless if it is async or not
def startup():
def decorator(func: typing.Callable):
if __name__ == "__main__":
if asyncio.iscoroutinefunction(func):
asyncio.run(func())
else:
func()
return func
return decorator

Keybase proof

I hereby claim:

  • I am ogtega on github.
  • I am ogtega (https://keybase.io/ogtega) on keybase.
  • I have a public key ASDgQeVQa4ezUEI4d1EHU58VrfrDgvMqWs04HtzdZ5KgFgo

To claim this, I am signing this object: