Skip to content

Instantly share code, notes, and snippets.

Reverse Engineering SP110e LED Controller

Through Bluetooth sniffing, using this method I've been able to (semi reliably) control the SP110e controller via Homebridge.

You can find this controller for very cheap here: https://www.aliexpress.com/item/4000773623427.html?spm=a2g0o.productlist.0.0.4f09329cJ7C1H4&algo_pvid=542e757b-587f-4540-8652-2195883f1349&algo_expid=542e757b-587f-4540-8652-2195883f1349-0&btsid=0bb0622a16012309671478585ed4bd&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

This entire guide is for Bluetooth LE libraries, and uses hexidecimal.

LE configuration

//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
@bricklife
bricklife / ViewController.swift
Created March 8, 2018 01:45
UIPanGestureRecognizer on UIScrollView
//
// ViewController.swift
// PanOnScroll
//
// Created by Shinichiro Oba on 2018/03/08.
// Copyright © 2018 bricklife.com. All rights reserved.
//
import UIKit
@opedge
opedge / StyleTransfer.swift
Last active July 29, 2023 21:48
CoreML style transfer with Vision (workaround while VNPixelBufferObservation.pixelBuffer is broken)
import Foundation
import UIKit
import CoreML
import Vision
// Quick and dirty example of how to fix Vision VNPixelBufferObservation BAD_ACCESS.
// Please handle errors in swift by yourself, this code sample intended only for demonstration.
// MLModel must have multiArray output and Image input.
// Before using this functions install CoreMLHelpers from https://github.com/hollance/CoreMLHelpers
@kravik
kravik / detect-face-landmarks.swift
Last active July 18, 2018 22:19
iOS 11 Vision. Face detection
import Vision
//1
let sourceImage = UIImage(named: "jony.jpg")
var resultImage = sourceImage
//2
let detectFaceRequest = VNDetectFaceLandmarksRequest { (request, error) in
//4
if let results = request.results as? [VNFaceObservation] {
//5
for faceObservation in results {
@lachlanhurst
lachlanhurst / GameViewController.h
Created March 10, 2017 08:11
Pulse effect in SceneKit - Objective C
//
// GameViewController.h
// pulseeffectobjectivec
//
// Created by Lachlan Hurst on 10/3/17.
// Copyright © 2017 Lachlan Hurst. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <SceneKit/SceneKit.h>
@chris-hatton
chris-hatton / TreeView.swift
Last active September 20, 2016 15:52
Weekend Playground fun: TreeView
import UIKit
typealias Bough = (rotation:CGFloat, length: CGFloat, scale: CGFloat, hue: CGFloat)
final class TreeView : UIView {
private let limit = 10
private let boughs : [Bough] = [
(rotation: -25, length: 85, scale: 0.75, hue: 0.04),
(rotation: 30, length: 100, scale: 0.65, hue: 0.02)
@darklight721
darklight721 / INSTRUCTIONS.md
Last active December 7, 2020 12:57
Using MobX with decorators in React Native

Using MobX with decorators in React Native

The following instructions should work with React Native v0.32:

  1. Install mobx libraries.

    npm install mobx --save
    npm install mobx-react --save
@mackuba
mackuba / wwdc16.md
Last active March 5, 2023 21:28
New stuff from WWDC 2016

Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.

If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.

If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).


OSX → macOS 10.12 Sierra

@stinger
stinger / Swift3JSONStructs.swift
Last active May 26, 2023 10:58
Swift 3: JSON-serializable structs using protocols
//: # Swift 3: JSON-serializable structs using protocols
//: Most of the implementation is based on the code in [this blog post](http://codelle.com/blog/2016/5/an-easy-way-to-convert-swift-structs-to-json/)
import Foundation
//: ### Defining the protocols
protocol JSONRepresentable {
var JSONRepresentation: Any { get }
}
protocol JSONSerializable: JSONRepresentable {}