Skip to content

Instantly share code, notes, and snippets.

View sonthonaxrk's full-sized avatar
👁️
Focusing

RK sonthonaxrk

👁️
Focusing
View GitHub Profile
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import (declarative_base, declared_attr,
AbstractConcreteBase)
engine = create_engine('sqlite://', echo=True)
Base = declarative_base()
Base.metadata = MetaData()
drop table if exists metadata cascade ;
drop table if exists obj1;
drop table if exists obj2;
drop table if exists parent_child;
CREATE EXTENSION IF NOT EXISTS pgcrypto;
/* This table is common across tables */
create table metadata (
id serial primary key,
@sonthonaxrk
sonthonaxrk / sql.py
Last active February 24, 2022 10:52
Contains eager, multiple of same type
from sqlalchemy import *
from sqlalchemy.orm import *
Base = declarative_base()
class Account(Base):
__tablename__ = "account"
id = Column(Integer, primary_key=True)
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import AbstractConcreteBase
Base = declarative_base()
class User(Base):
__tablename__ = "user"
@sonthonaxrk
sonthonaxrk / Old Technical Tests.md
Last active February 4, 2021 12:03
All the technical tests I have done

List of Technical Tests I Have Done

In my career I have done a great number of technical tests. Some I merely did as exercises for myself knowing that I was probably not going to get the job, and hoped to merely expand my skillset. I've obviously developed as a developer over the years, but I'm pleased with most of the tests I have done.

However, at this point I hope that anyone who wishes to hire me will examine this first, before compelling me to add yet another example of Django, Flask or a simple algorithm.

B2C2

import asyncio
import ipywidgets as widgets
from IPython.display import display
def wait_for_click(button):
future = asyncio.Future()
def getvalue(button):
# make the new value available
future.set_result(True)
@sonthonaxrk
sonthonaxrk / async_gui_kernel.py
Last active January 31, 2021 13:49
This IPython kernel can take GUI messages
import zmq
import sys
from typing import Any, Tuple
from tornado import gen
from ipykernel.ipkernel import IPythonKernel
from devtools import pformat
from ipykernel.kernelbase import (
CONTROL_PRIORITY, SHELL_PRIORITY, ABORT_PRIORITY
)
import re
import pampy
S3_MATCHING_RULES = {
re.compile("/(?P<Bucket>([^\\/]+))/(?P<Key>(.*))\\?restore"): {
"restore_object": {
"header": {},
"method": "POST",
"querystring": {},
@sonthonaxrk
sonthonaxrk / kubernetes-helm.rb
Created October 2, 2019 12:20
2.11.0 Helm Homebrew
class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/helm/helm.git",
:tag => "v2.11.0",
:revision => "2e55dbe1fdb5fdb96b75ff144a339489417b146b"
head "https://github.com/helm/helm.git"
bottle do
cellar :any_skip_relocation
((Mr|Ms|Dr|Sr)(\.)?)(?!\w)(\.)?