Skip to content

Instantly share code, notes, and snippets.

View Curiouspaul1's full-sized avatar
1️⃣
Working from school

Curious Paul Curiouspaul1

1️⃣
Working from school
View GitHub Profile
@Curiouspaul1
Curiouspaul1 / decorators.py
Created August 17, 2019 01:05 — forked from pcdinh/decorators.py
Flask login_required decorator
from flask import request, g
from functools import wraps
def login_required(f=None, url="public.login", next=None):
"""
Check if user is logged or redirect to a certain page.
By default go to public login.
"""
def outer_decorator(decorated_fn):
@Curiouspaul1
Curiouspaul1 / firestore_helper.py
Created April 8, 2022 05:55
Firestore Helper [Python client]
from google.cloud import firestore
from google.cloud.firestore_v1 import base_client
from google.oauth2 import service_account
from typing import Dict, List
import os
import json
import datetime as dt
import uuid
# declare root level path
@Curiouspaul1
Curiouspaul1 / alternative-scheduler-for-celery.py
Created May 22, 2022 04:10 — forked from amitripshtos/alternative-scheduler-for-celery.py
Alternative to celery beat for people who got burned hard
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.executors.pool import ThreadPoolExecutor
from apscheduler.jobstores.memory import MemoryJobStore
from apscheduler.job import Job
import json
import logging
from apscheduler.triggers.cron import CronTrigger
import time
from celery import Celery
from typing import List
@Curiouspaul1
Curiouspaul1 / project-ideas01.md
Created June 13, 2023 00:14 — forked from MWins/project-ideas01.md
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@Curiouspaul1
Curiouspaul1 / range_type.py
Last active June 17, 2024 01:25
A `Range` type in python that ensures that a value is within a certain range of positive values (not inclusive of the last)
ranged_int = type('ranged_int', (int,), {})
# # define a type alias
# type RangedInt = int
class RangeObj:
def __new__(self, floor, ceil):
if ceil <= floor or floor >= ceil:
raise ValueError(