Skip to content

Instantly share code, notes, and snippets.

@billiegoose
billiegoose / ArduinoSerialBypass.ino
Created July 19, 2013 01:37
Use your Arduino as a direct USB to serial converter! Tested on an Arduino Duemilanove. Probably 3.3V TTL but worked for communicating with my supposedly 5V TTL HerkuleX servo at 115200 baud.
/*
* Arduino Serial Bypass - use an Arduino as a dumb USB 2 Serial Converter
*
* This code makes the Arduino not interfere with pins 0 and 1
* which are connected to RX and TX on the FTDI chip. This allows
* the data coming from the FTDI USB 2 Serial chip to flow directly
* to another device. Since RX and TX are labeled from the Arduino's
* point of view, don't cross the wires, but plug the device's
* RX wire into the RX pin 0 and the TX wire into the TX pin 0.
*
@sander
sander / ancs.js
Last active February 5, 2021 16:02
BLE to stdin/stdout
var bleancs = require('ble-ancs')
var t = require('transit-js')
var writer = t.writer('json')
var reader = t.reader('json')
function status(v) {
return t.map([t.keyword('type'), t.keyword('status'),
t.keyword('value'), t.keyword(v)])}
function notif(v) {
return t.map([t.keyword('type'), t.keyword('notification'),
package tw.com.acme_soft.mibandscanner;
import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.util.Log;
import android.widget.Toast;
import com.zhaoxiaodan.miband.ActionCallback;
import com.zhaoxiaodan.miband.MiBand;
import com.zhaoxiaodan.miband.listeners.NotifyListener;
@darcyliu
darcyliu / iOS8InternalAppIDs.txt
Created June 10, 2016 21:32
iOS8 Internal App IDs
com.apple.SharedWebCredentialViewService
com.apple.FacebookAccountMigrationDialog
com.apple.mobilesafari
com.apple.AdSheetPhone
com.apple.share
com.apple.appleaccount.AACredentialRecoveryDialog
com.apple.Preferences
com.apple.WebContentFilter.remoteUI.WebContentAnalysisUI
com.apple.Passbook
com.apple.TrustMe
@MightyPork
MightyPork / usb_hid_keys.h
Last active May 13, 2024 09:57
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
import Cocoa
import CoreBluetooth
import PlaygroundSupport
public class BTHelper: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate {
// BLE Access
var centralManager: CBCentralManager
override init() {
self.centralManager = CBCentralManager(delegate: nil, queue: nil)

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@bgloh
bgloh / MibandService.java
Created July 7, 2017 03:14
Mi band Service UUID
package me.flyingrub.mibandnotify.miband;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class MiBandService {
public static final String MAC_ADDRESS_FILTER = "88:0F:10";
import UIKit
class ViewController: UIViewController {
var btHelper: BTHelper = BTHelper()
var timer: Timer? = nil
var bgTask = BackgroundTask()
@objc func stop() { btHelper.shutOff() }
@objc func action() { btHelper.startUp() }
@stonehippo
stonehippo / Adafruit_nrf52_example.ino
Last active June 25, 2021 21:39
Some example Arduino IDE code showing how to do various things with Adafruit nrF52 Feather BLE
/*
* Adafruit nRF52 Feather Example
* Copyright (c) 2018-2019 George White <stonehippo@gmail.com>
*
* MIT LICENSE, see LICENSE.txt at https://gist.github.com/stonehippo/ffbed2f32e1813f4019ecedd22062636
*
* I made this example file for a coworker. It illustrates a few things:
*
* - Setting up a custom service
* - Setting up custom characteristics on that service