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
// | |
// RotatingModel3D.swift | |
// VisionProPlacement | |
// | |
// Created by Jacob Van Order on 3/23/24. | |
// | |
import SwiftUI | |
import RealityKit |
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
- (void)fetchTrainResponseForLine:(NSString *)lineCode | |
origin:(NSString *)originCode | |
destination:(NSString *)destinationCode | |
andCallback:(SGMetraTrainResponseCallback)trainResponseCallback { | |
NSURL *metraURL = [NSURL URLWithString:@"http://12.205.200.243/AJAXTrainTracker.svc/GetAcquityTrainData"]; | |
NSMutableURLRequest *metraRequest = [[NSMutableURLRequest alloc] initWithURL:metraURL]; | |
NSData *requestJson = [[NSString stringWithFormat:@"{\"stationRequest\":{\"Corridor\":\"%@\",\"Destination\":\"%@\",\"Origin\":\"%@\",\"timestamp\":\"/Date(%i-0000)/\"}}", lineCode, destinationCode, originCode, (int)[[NSDate date] timeIntervalSince1970]] dataUsingEncoding:NSUTF8StringEncoding]; | |
[metraRequest setHTTPBody:requestJson]; |
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
// | |
// AppDelegate.swift | |
// | |
// Created by Jacob Van Order on 10/19/16. | |
// | |
// | |
import UIKit | |
//@UIApplicationMain |
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
#!/bin/bash | |
#Must have imagemagick installed… | |
NUMBER_OF_PIXELS=$(compare -metric ae $1 $2 null: 2>&1) | |
identify -format "%[fx:$NUMBER_OF_PIXELS*100/(w*h)]" $1 |
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
fastlane_version "1.46.0" | |
default_platform :ios | |
platform :ios do | |
desc "Get plist values" | |
lane :plist do | |
# plist_file_path = "AppProject/Info.plist" #works | |
# plist_file_path = sh("xcodebuild -project ../AppProject.xcodeproj -showBuildSettings -configuration Release | grep \"INFOPLIST_FILE\" | sed 's/[ ]*INFOPLIST_FILE = //'") #doesn't work |
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
if [ "${CONFIGURATION}" = "Release" ]; then | |
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}") | |
CFBundleVersion=$(($CFBundleVersion + 1)) | |
echo $CFBundleVersion | |
$PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "$buildPlist" | |
$PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "$INFOPLIST_FILE" | |
$PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "${DWARF_DSYM_FOLDER_PATH}/${WRAPPER_NAME}.dSYM/Contents/Info.plist" |
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
@IBAction func viewDragged(sender: UIPanGestureRecognizer) { | |
let yTranslation = sender.translationInView(view).y | |
if (hasExceededVerticalLimit(topViewConstraint.constant)){ | |
totalTranslation += yTranslation | |
topViewConstraint.constant = logConstraintValueForYPosition(totalTranslation) | |
if(sender.state == UIGestureRecognizerState.Ended ){ | |
animateViewBackToLimit() | |
} | |
} else { | |
topViewConstraint.constant += yTranslation |
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
/* Catch and use the model object*/ | |
@interface PresentedViewController() | |
@property (nonatomic, strong) SGYourActionModelObject *actionBlockObject; | |
@end | |
- (void)awakeWithContext:(id)context { | |
NSAssert([context isKindOfClass:[SGYourActionModelObject class]], @"Expected SGYourActionModelObject") |
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
func application(application: UIApplication!, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]!, reply: (([NSObject : AnyObject]!) -> Void)!) { | |
/* Synchronous | |
let response : (DateTime?, NSError?) = Network.fetchDateTime() | |
if let checkedDateTime = response.0 { | |
reply(["response": NSKeyedArchiver.archivedDataWithRootObject(checkedDateTime)]) | |
} | |
else if let checkedError = response.1 { | |
reply(["error": NSKeyedArchiver.archivedDataWithRootObject(checkedError)]) | |
} | |
else { |
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 <UIKit/UIKit.h> | |
#import <ImageIO/ImageIO.h> | |
#import <MobileCoreServices/MobileCoreServices.h> | |
static UIImage *frameImage(CGSize size, CGFloat radians) { | |
UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
[[UIColor whiteColor] setFill]; | |
UIRectFill(CGRectInfinite); | |
CGContextRef gc = UIGraphicsGetCurrentContext(); | |
CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |
NewerOlder