Skip to content

Instantly share code, notes, and snippets.

View nagavenkateshgavini's full-sized avatar
🎯
Focusing

Naga Venkatesh Gavini nagavenkateshgavini

🎯
Focusing
View GitHub Profile
@emmanuelnk
emmanuelnk / db.py
Last active May 9, 2024 07:46
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()
@ronreiter
ronreiter / sqlalchemy_example.py
Created August 10, 2015 06:21
SQLAlchemy Example
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()
@fredrick
fredrick / screen.md
Created September 14, 2011 15:30
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@alvesjnr
alvesjnr / sqlalchemy.py
Created June 2, 2011 22:32
First example using sqlalchemy
import sqlalchemy
engine = sqlalchemy.create_engine('sqlite:///:memory:', echo=False)
from sqlalchemy.ext.declarative import declarative_base
from Crypto.Hash import SHA256
from sqlalchemy.orm import relationship, backref
Base = declarative_base()
class User(Base):