Skip to content

Instantly share code, notes, and snippets.

View Filimoa's full-sized avatar

Sergey Filimonov Filimoa

View GitHub Profile
@rosswd
rosswd / multi-git-win.md
Last active December 30, 2024 13:49
Setting up a Github and Bitbucket account on the same computer on Mac OS. Now with a guide for Windows 10.

Setting up github and bitbucket on the same computer (Windows)

Guide for Windows

mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.

Github will be the main account and bitbucket the secondary.

Git for Windows

  • Download and install Git for Windows
    • In the installer, select everything but decide if you want a desktop icon (2nd step)
@juanplopes
juanplopes / schedule.py
Created September 30, 2014 13:13
Simple scheduling algorithm in python (2nd version)
import heapq
def schedule(tasks):
heap = []
def offer(begin, end):
while heap and heap[0] <= begin:
heapq.heappop(heap)
heapq.heappush(heap, end)
return len(heap)
@ibraheem4
ibraheem4 / postgres-brew.md
Last active April 19, 2025 14:27 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update

Prepare for SQL interview questions

Tutorial

SQL tutorial: https://tutorial.techaltum.com/SQLServer.html

Sample questions and solutions

@Filimoa
Filimoa / app.py
Last active March 9, 2025 07:50
FastAPI Stripe Checkout
"""
Based off Stripe's checkout repo, see the link for the Flask analogue.
https://github.com/stripe-samples/checkout-one-time-payments/blob/master/server/python/server.py
Assumes project is structured like:
src/
backend/
app.py
@imankulov
imankulov / sqlalchemy_with_pydantic.py
Last active April 29, 2025 00:17
Using pydantic models as SQLAlchemy JSON fields (convert beween JSON and pydantic.BaseModel subclasses)
#!/usr/bin/env ipython -i
import datetime
import json
from typing import Optional
import sqlalchemy as sa
from sqlalchemy.orm import declarative_base, sessionmaker
from sqlalchemy.dialects.postgresql import JSONB
from pydantic import BaseModel, Field, parse_obj_as
@Filimoa
Filimoa / leetcode_sql_problem_statements_to_db_tables.py
Last active April 11, 2025 05:04
LeetCode SQL Problem Statement to local database
import re
from typing import Dict
from io import StringIO
from dateutil import parser
from sqlalchemy import create_engine
import pandas as pd
def is_date(string):
if string.isnumeric():
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.