brightdigit.com
517.325.3123
awk ' | |
/^(class|protocol|extension|struct|enum) ([a-zA-Z]+)/ {close(file); ++count; file=$2"."$1".swift"; print file; close file;} | |
file {print line > file} | |
{line=$0} | |
' RssReader.swift |
brightdigit.com
517.325.3123
# Created by https://www.gitignore.io/api/macos | |
# Edit at https://www.gitignore.io/?templates=macos | |
### macOS ### | |
# General | |
.DS_Store | |
.AppleDouble | |
.LSOverride |
public struct Tweet : Codable { | |
public let created_at : Date | |
public let id : Int | |
public let full_text : String | |
public let display_text_range : [Int] | |
public let entities : TweetEntities | |
public let source : String | |
public let in_reply_to_status_id : Int? | |
public let in_reply_to_user_id : Int? | |
public let in_reply_to_screen_name : String |
#!/bin/sh | |
FRAMEWORKS_FOLDER_PATH="`dirname $1`/Frameworks/" | |
LIBS=`otool -L "$1" | grep "/opt\|Cellar" | awk -F' ' '{ print $1 }'` | |
for lib in $LIBS; do | |
EXPECTED_PATH="`dirname $1`/Frameworks/`basename $lib`" | |
if [ ! -f $EXPECTED_PATH ]; then | |
IFS='.' read -ra FILENAME_COMPS <<< "`basename $lib`" | |
ACTUAL_PATH=`find $FRAMEWORKS_FOLDER_PATH -name "${FILENAME_COMPS[0]}*.*"` | |
install_name_tool -id @rpath/`basename $ACTUAL_PATH` "`dirname $1`/Frameworks/`basename $ACTUAL_PATH`" |
set mol_list to {} | |
-- This will ask you to select a file containing the intended recepients and their emails -- | |
-- I also include in this file information needed to link to an attachment -- | |
set theFile to choose file with prompt "Select a text file:" | |
set theFileReference to open for access theFile | |
-- Note that the line end here is an old Mac return (not MSFT carriage return) -- | |
set theFileContents to read theFileReference using delimiter linefeed | |
close access theFileReference | |
-- Now parse the file that was selected. Here I'm parsing a tab-delimited file. -- |
func startWorkoutWithHealthStore(_ healthStore: HKHealthStore, | |
andActivityType activityType: HKWorkoutActivityType, | |
withSampleTypes sampleTypes: [HKSampleType]) -> HKWorkoutSession { | |
let configuration = HKWorkoutConfiguration() | |
configuration.activityType = activityType | |
let session : HKWorkoutSession | |
do { | |
session = try HKWorkoutSession(configuration: configuration) | |
} catch let error { |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate | |
{ | |
... | |
func applicationShouldRequestHealthAuthorization(_ application: UIApplication) { | |
let healthStore = HKHealthStore() | |
healthStore.handleAuthorizationForExtension { | |
(success, error) -> Void in | |
} | |
} |
// CaseIterable gives us the allCases properties | |
enum Suit : CaseIterable { | |
case clubs, hearts, diamonds, spades | |
} | |
// CaseIterable gives us the allCases properties | |
enum Rank : CaseIterable { | |
case two, three, four, five, six, seven, eight, nine, ten, jack, queen, king, ace | |
} |