Skip to content

Instantly share code, notes, and snippets.

View artvel's full-sized avatar

artvel artvel

  • Switzerland
View GitHub Profile
@artvel
artvel / PHAsset
Last active January 5, 2021 02:11
remove photo or video file in ios by the well known classic path
import Photos
extension PHAsset {
public static func removeAssets(_ paths: [String]){
let assets = PHAsset.assetsByPaths(paths)
if (assets.count > 0) {
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.deleteAssets(assets as NSArray)
}) { (result, error) in
// done
@artvel
artvel / main.go
Created April 1, 2021 18:21
QNAP TVS-472XT-PT-4G LED Display Controller
package main
import (
"display"
"fmt"
"log"
"os"
"os/signal"
)
//Example of how to use