Skip to content

Instantly share code, notes, and snippets.

View Sofrosyn's full-sized avatar
🏛️
With ❣️from 9JA

Sofrosyn Labs Sofrosyn

🏛️
With ❣️from 9JA
View GitHub Profile
@Sofrosyn
Sofrosyn / index.py
Created February 24, 2024 15:12
Invite brevo template
def invite(recipient_email, recipient_name, sender_name):
# OTP Template id from brevo
invite_template_id = 4
api_instance = sib_api_v3_sdk.TransactionalEmailsApi(sib_api_v3_sdk.ApiClient(configuration))
# Specify recipient name, sent as subject of email
subject = f"Hey {recipient_name}, join the world's leading academic minds at Unizonn!"
@Sofrosyn
Sofrosyn / complete_university_guide.py
Created January 26, 2024 10:55
Script to get courses
import time
import pandas as pd
from selenium.webdriver.common.by import By
import config
from src.room.room import session, University
all_university = []
@Sofrosyn
Sofrosyn / db.py
Created December 11, 2023 09:04 — forked from emmanuelnk/db.py
Python SQLAlchemy Basic Model, Session, DB Connection Classes
from sqlalchemy import event
import os
import logging
import sqlalchemy
import boto3
import base64
import json
from botocore.exceptions import ClientError
logger = logging.getLogger()
@Sofrosyn
Sofrosyn / LocalRepository.kt
Created July 25, 2023 22:31 — forked from crazygit/LocalRepository.kt
Jetpack DataStore in MVVM
import com.github.crazygit.tikheart.TikHeartApplication
import com.github.crazygit.tikheart.data.dao.UserInfoDao
import com.github.crazygit.tikheart.data.model.UserInfo
import com.github.crazygit.tikheart.utilities.LocalStorage
object LocalRepository {
private val localStorage = LocalStorage(TikHeartApplication.appContext)
private val localUserDao = UserInfoDao(localStorage)
from sqlalchemy import Column, Integer, String, ForeignKey, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref, sessionmaker, joinedload
# For this example we will use an in-memory sqlite DB.
# Let's also configure it to echo everything it does to the screen.
engine = create_engine('sqlite:///:memory:', echo=True)
# The base class which our objects will be defined on.
Base = declarative_base()
@Sofrosyn
Sofrosyn / PULL_REQUEST_TEMPLATE
Created April 12, 2023 22:52 — forked from riggaroo/PULL_REQUEST_TEMPLATE
Pull request template format. Add this file to your .github folder
<!--- Provide a general summary of your changes in the Title above -->
<!--- If there is no changelog entry, label this PR as trivial to bypass the Danger warning -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
@Sofrosyn
Sofrosyn / config.py
Last active April 1, 2023 21:01
WebDriver Configuration
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
import time as time
import selenium.webdriver.common.keys as keys
import selenium.webdriver.common.by as By
from selenium.webdriver.support.ui import Select
chromeService = Service("/Users/newowner/Documents/Learning/Tutorials/Python-Crash-Course/selenium/chromedriver.exe")
@Sofrosyn
Sofrosyn / AndroidXI.java
Last active March 5, 2023 19:34 — forked from fiftyonemoon/AndroidXI
File create, rename, duplicate and delete in Android11.
import android.app.PendingIntent;
import android.app.RecoverableSecurityException;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.IntentSender;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
@Sofrosyn
Sofrosyn / MainActivity.kt
Created July 23, 2022 23:47 — forked from mitchtabian/MainActivity.kt
Basics #7: Multiple Bindings of the same type
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.components.ApplicationComponent
import javax.inject.Inject
import javax.inject.Qualifier
import javax.inject.Singleton