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
// | |
// NSData+Base64.h | |
// base64 | |
// | |
// Created by Matt Gallagher on 2009/06/03. | |
// Copyright 2009 Matt Gallagher. All rights reserved. | |
// | |
// This software is provided 'as-is', without any express or implied | |
// warranty. In no event will the authors be held liable for any damages | |
// arising from the use of this software. Permission is granted to anyone to |
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
# Mac OS X | |
*.DS_Store | |
# Xcode | |
*.pbxuser | |
*.mode1v3 | |
*.mode2v3 | |
*.perspectivev3 | |
*.xcuserstate | |
project.xcworkspace/ |
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
// Scanner+Swift.swift | |
// | |
// A set of idiomatic swift extensions to Scanner | |
// | |
// Based on https://gist.github.com/natecook1000/59bb0c9117b555f5d40d | |
// Converted to Swift 3 | |
// | |
import Foundation |
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 -tt | |
""" | |
Module documentation. | |
""" | |
# Imports | |
import sys | |
#import os | |
# Global variables |
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
// | |
// LoggingPrint.swift | |
// | |
import Foundation | |
/** | |
Prints the filename, function name, line number and textual representation of `object` and a newline character into | |
the standard output if the build setting for "Active Complilation Conditions" (SWIFT_ACTIVE_COMPILATION_CONDITIONS) defines `DEBUG`. |
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
{ | |
"keymap": [ | |
{ | |
"keyCode": 52, | |
"label": "'" | |
}, | |
{ | |
"keyCode": 54, | |
"label": "," | |
}, |
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
// I needed to fetch all the pages from a paged endpoint. | |
// In this specific case, the JSON results contained a `pagingStatus` section that provided extra information which I could use: | |
// Hiding that behind a protocol: | |
import Foundation | |
protocol PagedReturning { | |
var pagingStatus: PagingStatus { get } | |
} |
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 Foundation | |
import PlaygroundSupport | |
import SwiftUI | |
struct Content: View { | |
var body: some View { | |
Text("👋🏻, 🌍!") | |
} | |
} |
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
- (NSString *)uuidString { | |
// Returns a UUID | |
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault); | |
NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid); | |
CFRelease(uuid); | |
return uuidStr; | |
} |
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
// | |
// NSDate+RandomDate.h | |
// | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSDate (RandomDate) | |
- (NSDate *)randomDateInYearOfDate; |
NewerOlder