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": [
# do not stop on errors | |
--ignore-errors | |
# Write metadata to the video file | |
#--add-metadata | |
# skip modified time, use the current datetime for modification time | |
--no-mtime | |
# prefer mp4, and we don't need 4k |
#!/bin/bash | |
# pass in the file name of the source as first parameter | |
mkdir -p generated | |
rm generated/* | |
# remove alpha with a simple trick | |
sips -s format bmp "$1" --out tmp.bmp | |
sips -s format png tmp.bmp --out "$1" |
# automator Passes images in as argument | |
for f in "$@" | |
do | |
dc="$(GetFileInfo -d "$f")" # store creation date | |
dm="$(GetFileInfo -m "$f")" # store modification date | |
noExt=${f%.*} | |
# needs to be installed with brew install webp | |
newExt="$noExt".webp | |
/usr/local/bin/cwebp -q 90 "$f" -o "$newExt" | |
SetFile -d "$dc" "$newExt" # restore creation date |
package main | |
import ( | |
"log" | |
"github.com/cavaliercoder/grab" | |
) | |
func main() { | |
client := grab.NewClient() |
var folderName = 'untitledfolder'; | |
var nameTests = [ | |
{ | |
nr: 1, | |
fileSystemIn: [], | |
fileSystemOut: ['untitledfolder'], | |
}, |
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": [
// MPU6050 Includes | |
#include "Wire.h" | |
#include "I2Cdev.h" | |
#include "MPU6050.h" | |
// ESP8266 Includes | |
#include <ESP8266WiFi.h> | |
// DEFINE NODEMCU PINS | |
#define D0 16 |
#!/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 |
* { | |
box-sizing: border-box; | |
} | |
html, body { | |
margin: 0; | |
padding: 0; | |
height: 100vw; | |
width: 100vw; | |
} |
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 |