Skip to content

Instantly share code, notes, and snippets.

View jkocherhans's full-sized avatar

Joseph Kocherhans jkocherhans

  • Soundslice
  • Chicago, IL
View GitHub Profile
@nathanborror
nathanborror / playground.swift
Last active January 3, 2023 22:16
Custom UIKit view with child SwiftUI views
import UIKit
import SwiftUI
import PlaygroundSupport
// CustomParentView is a custom UIKit view. Its Coordinator can be used
// to manage delegates if needed (e.g. UIContextMenuInteractionDelegate).
struct CustomParentView<Content: View>: UIViewRepresentable {
let content: UIView
@jacobian
jacobian / check_postgres_replication.py
Created December 16, 2010 20:13
Nagios plugin to check PostgreSQL 9 streaming replication lag.
#!/usr/bin/env python
"""
Nagios plugin to check PostgreSQL 9 streaming replication lag.
Requires psycopg2 and nagiosplugin (both installable with pip/easy_install).
MIT licensed:
Copyright (c) 2010 Jacob Kaplan-Moss. All rights reserved.
import redis
from django.conf import settings
from django.core.signals import request_finished
try:
from eventlet.corolocal import local
except ImportError:
from threading import local