Skip to content

Instantly share code, notes, and snippets.

View ShonFrazier's full-sized avatar
🔹

Shon Frazier ShonFrazier

🔹
View GitHub Profile
@ShonFrazier
ShonFrazier / postgres-nanoid.sql
Created December 29, 2022 22:25 — forked from coreybutler/postgres-nanoid.sql
PostgreSQL NANOID
CREATE FUNCTION "nanoid"("size" int4 DEFAULT 21)
RETURNS text
LANGUAGE plpgsql
STABLE
AS
$$
DECLARE
id text := '';
i int := 0;
urlAlphabet char(64) := 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_0123456789';
@ShonFrazier
ShonFrazier / API.md
Last active October 29, 2022 16:53 — forked from iros/API.md
Documenting your REST API

Service Name

Title


<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

@ShonFrazier
ShonFrazier / HandleURI.swift
Last active September 15, 2016 01:50 — forked from anonymous/HandleURI.swift
Handle URIs with custom schemes on macOS
// After your application launches, register to handle Apple Events
func applicationDidFinishLaunching(_ aNotification: Notification)
{
let appleEventManager = NSAppleEventManager.shared()
appleEventManager.setEventHandler(self,
andSelector: #selector(AppDelegate.handleGetURLEvent(_:withReplyEvent:)),
forEventClass: AEEventClass(kInternetEventClass),
andEventID: AEEventID(kAEGetURL))
}
#import <objc/runtime.h>
void dumpInheritance(Class cls) {
do {
NSLog(@"%@", cls);
} while ((cls = class_getSuperclass(cls)) != [NSObject class]);
NSLog(@" = = %@ ends", @(__PRETTY_FUNCTION__));
}