Skip to content

Instantly share code, notes, and snippets.

import Foundation
import CoreMediaIO
let CMIOExtensionPropertyCustomPropertyData_just: CMIOExtensionProperty = CMIOExtensionProperty(rawValue: "4cc_just_glob_0000")
let CMIOExtensionPropertyCustomPropertyData_dust: CMIOExtensionProperty = CMIOExtensionProperty(rawValue: "4cc_dust_glob_0000")
...
class cameraStreamSource: NSObject, CMIOExtensionStreamSource {
@uttarwarsandesh33
uttarwarsandesh33 / deepCopyRecursion.js
Last active September 12, 2021 14:47
Create deep copy with recursive method
//recursive method to create deep copy
function deepCopy(obj) {
if (null === obj || 'object' !== typeof obj) return obj;
switch (obj.constructor) {
case Boolean:
return new Boolean(obj);
case Number:
return new Number(obj);
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created March 12, 2021 14:29
Code for Service Workers 8 - Messaging between Clients and Workers
const APP = {
SW: null,
init() {
//called after DOMContentLoaded
//register our service worker
APP.registerSW();
document
.getElementById('colorForm')
.addEventListener('submit', APP.saveColor);
// Don't forget to add to the project:
// 1. DeepLabV3 - https://developer.apple.com/machine-learning/models/
// 2. CoreMLHelpers - https://github.com/hollance/CoreMLHelpers
enum RemoveBackroundResult {
case background
case finalImage
}
extension UIImage {
@talkingmoose
talkingmoose / MegaPKGr.zsh
Last active June 26, 2023 05:37
The pkgbuild binary and Jamf Composer don't support adding single files of 8 GB or more to a package. Some apps like Install macOS Big Sur.app include files larger than 8 GB in their bundles. This script will create a deployable PKG file from apps whose bundles include those large files.
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/e9ed319226c6da30dd633725e48a97b0
@KyLeggiero
KyLeggiero / NSWindow+Fade.swift
Last active September 23, 2022 16:00 — forked from indragiek/NSWindow+Fade.h
NSWindow+Fade - Animator proxy based NSWindow fading
//
// NSWindow+Fade.swift
// BH Bezel Notification
//
// Created by Ben Leggiero on 2017-11-09.
// Translated to Swift 4 from the original (ObjC): https://gist.github.com/indragiek/1397050
// Copyright © 2017 Ben Leggiero. All rights reserved.
//
import Foundation
@KurtJacobson
KurtJacobson / touchscreen_calibration.md
Last active February 27, 2024 22:06
Touchscreen calibration procedue for Debian9 (stretch)

Touchscreen Calibration in Debian9

Unfortunately [xinput-calibrator][1] does not work at all for calibrating a touchscreen in Debian9. This is apparently because X server now uses libinput to handle input devices instead of evdev. I spent huge amount of trying to fiddling with xinput-calibrator and 99-calibration.conf files until I finely found this [issue][2] on GitHub that gave me some hints as how to proceed. This is mostly for my own reference, but I hope it might also help others in the same situation.

@psiphi75
psiphi75 / rPi3-ap-setup.sh
Last active January 7, 2018 20:02 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 wifi access-point-setup (AP) and internet sharing over ethernet
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
import WebKit
import UIKit
class WebViewController: UIViewController {
var url: URL!
var wKWebView: WKWebView!
@IBOutlet weak var containerView: UIView!
@IBOutlet weak var goBackButton: UIBarButtonItem!
@IBOutlet weak var goForwardButton: UIBarButtonItem!
@celian-m
celian-m / SessionDelegate.swift
Created January 13, 2017 16:33
Perform client side certificate check
import Foundation
public struct IdentityAndTrust {
public var identityRef:SecIdentity
public var trust:SecTrust
public var certArray:NSArray
}
public func extractIdentity(certData:NSData, certPassword:String) -> IdentityAndTrust {