Skip to content

Instantly share code, notes, and snippets.

View bdotdub's full-sized avatar

Benny Wong bdotdub

View GitHub Profile
import PlaygroundSupport
import SwiftUI
struct CityRow: View {
var body: some View {
Text(place)
}
var place: String
}

CoreBluetooth not discovering peripherals

rdar://23374935

Summary:

Bluetooth LE devices are never detected by a CBCentralManager when scanning for all devices.

Steps to Reproduce:

  1. Clone and run a Bluetooth LE peripheral, e.g. git clone git@github.com:sandeepmistry/osx-ble-peripheral.git
  2. Clone this example on an Apple TV: git clone git@github.com:bdotdub/CBExample.git
#!/bin/bash
hash fswatch 2>/dev/null || brew install fswatch
function stopping() {
echo "Done"
exit 0
}
trap stopping SIGINT
@bdotdub
bdotdub / futurable1.rb
Last active August 29, 2015 13:59
This don't make nooo sense. In theory, it should be almost semantically equivalent, `Futurable1` making only one more access to `Celluloid::Actor[:Futurable1]`. The `||=` is essentially checking for `nil` before assigning. Why it's such a big difference, I'd love to know.
require "benchmark"
require "celluloid"
class Futureable1
include Celluloid
class << self
def p
if Celluloid::Actor[:Futureable1].nil?
Celluloid::Actor[:Futureable1] = Futureable1.pool(size: 2)

Keybase proof

I hereby claim:

  • I am bdotdub on github.
  • I am bdotdub (https://keybase.io/bdotdub) on keybase.
  • I have a public key whose fingerprint is B18B F283 8D8D AD9C 1ADA 4E47 6831 9EB8 C97E 1325

To claim this, I am signing this object:

var $apps = $(".app");
var costTable = function(csv, year, month, appName, $app, type) {
console.log(csv, appName, $app, type);
var $dynos = $app.find("." + type + " tbody tr");
for (var j = 0; j < $dynos.length; j++) {
var $dyno = $($dynos.get(j));
var $fields = $dyno.find("td");
if ($fields.length != 4) {
@bdotdub
bdotdub / README.md
Last active August 29, 2015 13:55
Map for Brokelyn's Beer Book 6
@bdotdub
bdotdub / gist:5877359
Created June 27, 2013 15:20
3.2 Rails.cache weirdness
Loading development environment (Rails 3.2.13)
1.9.3p286 :001 > Rails.cache.fetch("test") { "benny" }
=> "benny"
1.9.3p286 :002 > Rails.cache.fetch("test") { "benny" }
=> "\x04\bI\"\nbenny\x06:\x06ET"
@bdotdub
bdotdub / README.md
Created February 1, 2013 20:38
Map for Brokelyn's Beer Book 3
@bdotdub
bdotdub / README.md
Created February 1, 2013 20:35
Map for Brokelyn's Beer Book 4