Skip to content

Instantly share code, notes, and snippets.

View giomurru's full-sized avatar

Giovanni Murru giomurru

View GitHub Profile
@giomurru
giomurru / PressButton.swift
Last active June 1, 2022 14:17
A UIButton for tvOS that continuously sends events when pressed
//
// PressButton.swift
//
// Created by Giovanni Murru on 31/05/22.
// Copyright © 2022 Giovanni Murru.
//
// 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
@giomurru
giomurru / LandmarksBBox.swift
Created July 5, 2021 14:51
VNFaceObservation: Computes the landmarks normalized on the smallest bounding box which includes all of the landmarks.
extension VNFaceObservation {
func landmarksBBox(_ imageSize: CGSize) -> (bbox: CGRect, landmarks: [CGPoint]) {
guard let allPoints = self.landmarks?.allPoints?.pointsInImage(imageSize: imageSize),
allPoints.count > 0 else { return (CGRect.zero, []) }
var maxX : CGFloat = -CGFloat.greatestFiniteMagnitude
var minX : CGFloat = CGFloat.greatestFiniteMagnitude
var maxY = maxX
var minY = minX
@giomurru
giomurru / steps_to_deploy_website_through_git.txt
Last active March 4, 2021 17:56
steps to deploy website through git
# steps to deploy website through git
# login via ssh to your website
# create a folder where you want to store your bare repository
mkdir -p /home/username/gitrepos/myrepository.git
cd /home/username/gitrepos/myrepository.git
git init --bare