Skip to content

Instantly share code, notes, and snippets.

@choefele
choefele / description.txt
Created January 4, 2021 19:13
Map Logitech Wireless Presenter Keys to Work in Zoom and Teams (macOS)
Logitech wireless presenters, such as the R700, function as simple keyboards. However, the standard key mapping only works with PowerPoint. When in a video conference, I prefer to have the keys mapped to volume up/down, mute on/off, and video on/off. That way, I can control these features even when further away from the keyboard.
Here is how to achieve this:
- Download and install Karabiner https://pqrs.org/osx/karabiner/ (Karabiner requires Input Monitoring permission)
- Download logitech.json from this gist and move to ~/.config/karabiner/assets/complex_modifications
- Open Karabiner > Preferences... > Complex modifications
- Click Add rule
- Enable "Logitech + Zoom: Volume, Mute, Stop Video" and/or "Logitech + Teams: Volume, Mute, Stop Video" (keys get mapped only if these specific apps are in the foreground and only for the Logitech wireless presenter)
Note: you might need to check if the vendor_id and product_id are correct for your device (Open Karabiner > Preferences... > Devices)
source 'https://rubygems.org'
gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git'
@choefele
choefele / gist:c4a31862d91cba9ac364
Created May 26, 2015 09:56
NSLogger – logMessage()
private class func logMessage(message: String) {
let appID = NSBundle.mainBundle().bundleIdentifier
LogMessage_va(appID, 0, message, getVaList([]))
}
@choefele
choefele / gist:3bbdc9b7146f69b0cb70
Last active August 29, 2015 14:21
NSLogger – startNSLogger()
private class func startNSLogger() {
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true);
let file = "\(paths.first!)/loggerdata"
let bundleName = NSBundle.mainBundle().objectForInfoDictionaryKey(kCFBundleNameKey as String) as! String
let logger = LoggerInit()
LoggerSetBufferFile(logger, file)
LoggerSetOptions(logger, UInt32(kLoggerOption_BufferLogsUntilConnection | kLoggerOption_BrowseBonjour | kLoggerOption_BrowseOnlyLocalDomain))
LoggerSetupBonjour(logger, nil, bundleName)
LoggerStart(nil)
@choefele
choefele / Podfile
Created May 26, 2015 09:53
NSLogger – Podfile
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs'
pod 'NSLogger'
@choefele
choefele / gist:99654168c75d9bd81d9d
Created May 16, 2015 21:03
handleWatchKitExtensionRequest background task
func application(application: UIApplication, handleWatchKitExtensionRequest userInfo: [NSObject : AnyObject]?, reply: (([NSObject : AnyObject]!) -> Void)!) {
let completionBlock: () -> Void = {
reply(nil)
UIApplication.sharedApplication().endBackgroundTask(self.updateCacheTask)
}
updateCacheTask = application.beginBackgroundTaskWithExpirationHandler(completionBlock)
if let userLocation = DataProviderUtils.userLocationForUserInfo(userInfo) {
DataProviderService.retrieveTripsForUserLocation(userLocation, completionBlock: completionBlock)
} else {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Build target Pods-CCHBinaryData
Write auxiliary files
/bin/mkdir -p /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build
write-file /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/module.modulemap
/bin/mkdir -p /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/Objects-normal/arm64
write-file /Users/choefele/Library/Developer/Xcode/DerivedData/Test-aprwsydqlazvlbacurkmubqnhure/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/Pods-CCHBinaryData.build/Objects-normal/arm64/CCHBinaryD
@choefele
choefele / gist:aaf0edfcd2656901c08e
Created April 28, 2015 10:59
CocoaPods Podfile use_frameworks
platform :ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs'
source '[email protected]:optionu/Specs.git'
link_with 'HereToThere Widget', 'HereToThere WatchKit Extension'
pod 'FontAwesomeKit/FontAwesome'
pod 'FontAwesomeKit/FoundationIcons'
@choefele
choefele / dispatch_after_cancellable
Created February 18, 2015 15:41
Cancellable dispatch block with delay
func dispatch_after_cancellable(when: dispatch_time_t, queue: dispatch_queue_t, block: dispatch_block_t) -> () -> Void {
var isCancelled = false
dispatch_after(when, queue) {
if !isCancelled {
block()
}
}
return { isCancelled = true }
}