Skip to content

Instantly share code, notes, and snippets.

@phmagic
phmagic / ApiKey.swift
Created February 18, 2024 15:27
Using iCloud for storing keys and then pushing into keychain of device.
import CloudKit
import Foundation
import Locksmith
/**
API Key used by this app is fetched from CloudKit. This class manages fetching and saving it into Keychain
*/
class ApiKey {
private static let RECORD_NAME = <# RECORD_NAME_IN_CLOUDKIT #>
private static let KEY = <# KEY_NAME_IN_CLOUDKIT #>
@phmagic
phmagic / tensorflow-macOS-sierra-GT750M-CUDA8.md
Last active November 4, 2021 06:48
Install TensorFlow GPU on NVIDIA GeForce GT 750M on macOS Sierra 10.12

Current as of Sept 6, 2017

I have a MacBook Pro Retina 2013 and I had a hard time setting up TensorFlow with GPU support from all the conflicting information out there. I hope this gets you up and running training models on your local computer!

  1. Download the CUDA Toolkit 8.0 for macOS here. Install it using the DMG package.
  2. Edit your ~/.bash_profile file and add the following line: export DYLD_LIBRARY_PATH="/Developer/NVIDIA/CUDA-8.0/lib:$DYLD_LIBRARY_PATH"
  3. Download the CUDA DNN v5.1 from here. This requires you to sign up as an NVIDIA Developer.
  4. Unzip the CUDA DNN package and copy the files inside the include folder to Developer/NVIDIA/CUDA-8.0/include and copy the files inside the lib folder into Developer/NVIDIA/CUDA-8.0/lib
  5. Inside your terminal, do source ~/.bash_profile
@phmagic
phmagic / homebridge
Created January 9, 2017 04:29 — forked from johannrichard/homebridge
Systemd Service for homebridge (http://github.com/nfarina/homebridge)
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*