This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[version] | |
version_string = 13.4 | |
version_number = 1D486D64 | |
ini_version = 2 | |
[network] | |
commands_per_frame = 2 | |
max_commands_in_queue = 16 | |
bytes_per_frame = 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple validation script for Route 53 record-set JSON outputs | |
Only validates some record types | |
aws route53 list-resource-record-sets --hosted-zone-id zone-id-old > old-dns.json | |
aws route53 list-resource-record-sets --hosted-zone-id zone-id-new > new-dns.json | |
""" | |
from __future__ import annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" Plugin Settings | |
let g:clang_library_path='/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1' | |
" Turn on syntax highlighting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl https://gist.githubusercontent.com/nZac/e200b656539b0aa311b579e25c258e36/raw > ~/.tmux.conf | |
# Prett Colors! Make sure iTerm2 is setup with "xterm-256color" | |
set -g default-terminal "screen-256color" | |
set -g terminal-overrides "" | |
set -g status-bg '#666666' | |
set -g status-fg '#aaaaaa' | |
set-option -g renumber-windows on | |
set -g update-environment "SSH_AUTH_SOCK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TempDropConstraint(object): | |
def __init__(self, table, column): | |
self.table = table | |
self.table_name = table.__tablename__ | |
self.column = column | |
self.constraint = list(self.table.__table__.columns[column.name].foreign_keys)[0] | |
self.constraint_name = self.constraint.name | |
self.referred_table = self.constraint.column.table.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
from typing import List, Optional | |
import dataclasses | |
import enum | |
INDENT = ' ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon | |
import falcon.media | |
import falcon.testing | |
class TextHandler(falcon.media.BaseHandler): | |
def serialize(self, media, content_type): | |
return str(media).encode() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon | |
import sqlalchemy | |
from .middleware import SQLAlchemyMiddleware | |
from .db import session | |
def create_app(config: dict): | |
session.configure(bind=sqlalchemy.create_engine(config.get('DATABASE_URL', 'sqlite://'))) | |
return falcon.API(middleware=[SQLAlchemyMiddleware(session)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
import sqlparse.format as sqlformat | |
except ImportError: | |
def sqlformat(query, **kwargs): | |
"""Monkey patch sqlparse.format if package not installed""" | |
return query | |
def debug_query(query, engine): | |
"""Return a parametrized and formated sql query for debugging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------- | |
-- SERVER LEVEL COMMANDS -- | |
--------------------------- | |
-- Create a new template database (we could alter template1 as well). | |
CREATE DATABASE "template2"; | |
-- This avoids possibly droping the template table | |
UPDATE pg_database SET datistemplate = true WHERE datname='template2'; |
NewerOlder