Skip to content

Instantly share code, notes, and snippets.

@conradev
conradev / transcript.md
Last active December 6, 2022 01:40
Coding with ChatGPT
$ ls
PROMPT.txt

$ cat PROMPT.txt
Your goal is to write a Swift program to enumerate the applications installed on this computer and to write this list to a file called applications.txt.

$ Swift applications.swift
<unknown>:0: error: invalid value 'Swift' in '--driver-mode='"
@conradev
conradev / NavigationStackView.swift
Last active May 16, 2023 09:55
NavigationStackView
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
WindowGroup {
OnboardingView()
}
}
}
@conradev
conradev / fmip_message.py
Last active August 15, 2016 22:07
Pings your iPhone
import json
import base64
import urllib2
def main():
username = ""
password = ""
subject = "Important Message"
message = "This is a test"
@conradev
conradev / mailgun-schema.json
Last active May 26, 2016 22:05
Mailgun webhook JSON schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://gist.githubusercontent.com/conradev/66a29bef1a113d254dc306acbd5b3bb4/raw/mailgun-schema.json",
"type": "object",
"properties": {
"domain": { "type": "string" },
"ip": { "type": "string" },
"tag": { "type": "string" },
"event": { "type": "string" },
"city": { "type": "string" },
@conradev
conradev / Person.m
Created March 4, 2016 06:54
Spot the error
@interface Person : NSObject
@property (nonatomic, readonly, copy) NSString *first;
@property (nonatomic, readonly, copy) NSString *last;
@property (nonatomic, readonly, copy) NSDate *birthdate;
@end
@implementation Person
@conradev
conradev / LICENSE
Created March 4, 2016 03:26
Vibrant buttons in Workflow
Copyright (c) 2014-2016 DeskConnect, Inc. (http://deskconnect.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@conradev
conradev / WFGoogleTranslateSessionManager.h
Last active February 6, 2016 15:51
WFGoogleTranslateSessionManager
//
// WFGoogleTranslateSessionManager.h
//
// Created by Conrad Kramer on 2/9/15.
// Copyright (c) 2015 DeskConnect. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@conradev
conradev / UIImage+CGImagePropertyOrientation.m
Created October 28, 2014 22:41
UIImage+CGImagePropertyOrientation
@implementation UIImage (CGImagePropertyOrientation)
- (CGImagePropertyOrientation)cgImagePropertyOrientation {
switch (self.imageOrientation) {
case UIImageOrientationUp:
return kCGImagePropertyOrientationUp;
case UIImageOrientationDown:
return kCGImagePropertyOrientationDown;
case UIImageOrientationLeft:
return kCGImagePropertyOrientationLeft;
@conradev
conradev / simulatorconsole
Last active December 16, 2015 00:45
simulatorconsole
#!/bin/bash
tail -f $(ls -t "$HOME/Library/Logs/CoreSimulator/"*/system.log | head -1)
@conradev
conradev / CKBlurDetection.h
Created January 27, 2014 19:28
UIKit Blur Detection
//
// CKBlurDetection.h
//
// Created by Conrad Kramer on 1/23/14.
// Copyright (c) 2014 Kramer Software Productions, LLC. All rights reserved.
//
extern BOOL CKBlurEnabled();