Skip to content

Instantly share code, notes, and snippets.

View joshp123's full-sized avatar

Josh Palmer joshp123

View GitHub Profile
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@maruno
maruno / cf-uuid.py
Created March 9, 2015 16:52
CF UUID
#!/usr/bin/env python
import sys
import uuid
def create_cf_uuid(uuid_str=None):
"""
Go from 8-4-4-4-12 to 8-4-4-16
"""
if not uuid_str:
uuid_str = str(uuid.uuid4())
@MattSurabian
MattSurabian / redis-one-line--pattern-delete.sh
Last active November 14, 2018 17:52
One liner for deleting based on a pattern in redis. KEYS supports wildcards, delete doesn't. No worries xargs to the rescue. You might not need HOST, or PORT depending on your setup. You might need to sudo BOTH commands depending on your setup.
redis-cli -h <HOST> -p <PORT> KEYS "<PATTERN>" | xargs -i% redis-cli -h <HOST> -p <PORT> DEL %