A thought experiment to map a coffee machine to Apple HomeKits format.
{
"name": "Machine A",
"serialNumber": "A343-GXOERK",
"model": "frank-17273-rev23",
"modelFriendly": "Coffeemaker A232",
"customerID": 1337,
"characteristics": [| // use it in calender: http://apple.stackexchange.com/a/59265/14030 | |
| app = Application.currentApplication() | |
| app.includeStandardAdditions = true | |
| ObjC.import('Cocoa') | |
| dict = $.NSDictionary.dictionaryWithContentsOfFile('/Library/Preferences/com.apple.TimeMachine.plist') | |
| firstItem = dict.valueForKey('Destinations').firstObject | |
| lastBackup = firstItem.valueForKey('SnapshotDates').lastObject | |
| diff = lastBackup.timeIntervalSinceNow // in seconds |
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "strconv" |
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <script> | |
| function fallback(e) { | |
| var filename = e.src.split('/').reverse()[0]; | |
| document.write('<script src="/libs/' + filename + '"><\/script>'); | |
| } | |
| </script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.14.2/react.min.js" onerror="fallback(this)"></script> |
| brew cleanup | |
| rm -r ~/Library/Application\ Support/HandBrake/EncodeLogs/ | |
| rm -r ~/Library/Application\ Support/Spotify/PersistentCache/Update/ | |
| rm -r ~/Library/Application\ Support/uTorrent/ | |
| rm -r ~/Library/Application\ Support/com.evernote.EvernoteHelper/logs | |
| find ~/Library/Application\ Support/Skype -name "media_messaging" -type d -exec rm -r "{}" \; | |
| rm -r ~/Library/Application\ Support/1Password/Backups | |
| rm -r ~/Library/Application\ Support/Sublime\ Text\ 3/Backup |
| * { | |
| box-sizing: border-box; | |
| } | |
| html, body { | |
| margin: 0; | |
| padding: 0; | |
| height: 100vw; | |
| width: 100vw; | |
| } |
| #!/bin/sh | |
| APIKEY=$(<apikey.txt) | |
| VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "Info.plist") | |
| PREV_TAG=$(curl -s https://api.github.com/repos/yene/DisplayBrightness/releases/latest | python -c "import json,sys;obj=json.load(sys.stdin);print obj['tag_name'];") | |
| if [ "$PREV_TAG" == "v$VERSION" ]; then | |
| echo "Error: This version is already published!" | |
| exit 1 | |
| fi | |
| git push origin master | |
| mkdir build |
| // MPU6050 Includes | |
| #include "Wire.h" | |
| #include "I2Cdev.h" | |
| #include "MPU6050.h" | |
| // ESP8266 Includes | |
| #include <ESP8266WiFi.h> | |
| // DEFINE NODEMCU PINS | |
| #define D0 16 |
A thought experiment to map a coffee machine to Apple HomeKits format.
{
"name": "Machine A",
"serialNumber": "A343-GXOERK",
"model": "frank-17273-rev23",
"modelFriendly": "Coffeemaker A232",
"customerID": 1337,
"characteristics": [| var folderName = 'untitledfolder'; | |
| var nameTests = [ | |
| { | |
| nr: 1, | |
| fileSystemIn: [], | |
| fileSystemOut: ['untitledfolder'], | |
| }, |
| package main | |
| import ( | |
| "log" | |
| "github.com/cavaliercoder/grab" | |
| ) | |
| func main() { | |
| client := grab.NewClient() |