Skip to content

Instantly share code, notes, and snippets.

View aclima93's full-sized avatar
💭
Including Bugs

António Lima aclima93

💭
Including Bugs
View GitHub Profile
@aclima93
aclima93 / .gitconfig
Last active October 25, 2023 08:06
useful git aliases
[user]
name = António Lima
email = <user@organization>
[alias]
# list aliases
alias = "!git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ /"
# push to origin [branch_name]
@aclima93
aclima93 / current_location.swift
Last active July 10, 2018 16:41
ARKit & CoreLocation + Current Locaiton
import CoreLocation
class ARCLViewController: UIViewController, CLLocationManagerDelegate {
var locationManager: CLLocationManager!
var latestLocation: CLLocation?
func setupLocation() {
// Setup location manager
locationManager = CLLocationManager()
@aclima93
aclima93 / poi_directions.swift
Last active August 21, 2018 14:57
ARKit & CoreLocation + POI + MapKit + Directions
func getRouteSegments(startCoordinate: CLLocationCoordinate2D, endCoordinate: CLLocationCoordinate2D) {
// Request the walking directions between the two points
let directionRequest = setupRouteDirectionsRequest(startCoordinate: startCoordinate, endCoordinate: endCoordinate)
let directions = MKDirections(request: directionRequest)
directions.calculate {
(response, error) -> Void in
guard let response = response else {
if let error = error {
print("Error: \(error)")
@aclima93
aclima93 / ar_poi_selection.swift
Last active August 21, 2018 14:58
ARKit & CoreLocation + POI + AR Interaction
var sceneLocationView: SceneLocationView!
var pois: [PointOfInterest]!
var locationAnnotationNode2POI: [LocationTextAnnotationNode: PointOfInterest]!
var selectedPOI: PointOfInterest?
func setupARScene() {
// create AR scene
sceneLocationView = SceneLocationView()
view.addSubview(sceneLocationView)
@aclima93
aclima93 / nearby_pois.swift
Last active August 21, 2018 14:57
ARKit & CoreLocation + Getting Nearby POIs
var locationManager: CLLocationManager!
var latestLocation: CLLocation?
var pois: [PointOfInterest]!
func getPOIs() {
// formulate natural language query for nearby POIs
let request = MKLocalSearch.Request()
request.naturalLanguageQuery = "Restaurants" // or any other thing you might be interested in
request.region = MKCoordinateRegion(center: (latestLocation?.coordinate)!,
@aclima93
aclima93 / LocationTextAnnotationNode.swift
Last active July 10, 2018 17:11
ARKit & CoreLocation + POI + AR Scene
open class LocationTextAnnotationNode: LocationNode {
// image and text that are displayed by the child nodes
public let image: UIImage
public let text: String
// child nodes
public let imageAnnotationNode: SCNNode
public let textAnnotationNode: SCNNode
@aclima93
aclima93 / add_poi_to_ar_scene.swift
Created July 10, 2018 17:06
ARKit & CoreLocation + POI + AR Scene
func addPOIToARScene(_ poi: PointOfInterest) {
// create node
let location = CLLocation(latitude: poi.latitude, longitude: poi.longitude)
let text = poi.title
let annotationNode = LocationTextAnnotationNode(location: location, image: UIImage(named: "LocationMarker")!, text: text)
// add node to AR scene
sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationNode)
}

Keybase proof

I hereby claim:

  • I am aclima93 on github.
  • I am aclima93 (https://keybase.io/aclima93) on keybase.
  • I have a public key ASDVtyOtAN-HfNRgZVWoyoP053JtAG1EMvqctW440zMDzAo

To claim this, I am signing this object:

#!/usr/bin/env bash
# default values
SRC=${1:-_site/}
DST=${2:-docs/}
USER_PAGE=${3:-../aclima93.github.io/}
BLOG_PAGE=${3:-../Blog/docs/}
# copy the contents from $SRC (_site/) to $DST (doc/) and serve that over at github-pages
rm -rf $DST;
@aclima93
aclima93 / SwiftConfigurationGenerator.swift
Created August 6, 2020 00:02
// A build phase script for fetching, validating and generating a Swift wrapper over configuration files in iOS projects
#!/usr/bin/env xcrun --sdk macosx swift
// A build phase script for fetching, validating and generating a Swift wrapper over configuration files in iOS projects
// Source: https://github.com/pgorzelany/SwiftConfiguration
import Foundation
public struct ParsedArguments {
public let configurationPlistFilePath: String
public let outputFilePath: String
}