This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/mongo_mapper/plugins/callbacks.rb | |
module MongoMapper | |
module Plugins | |
module Callbacks | |
module InstanceMethods | |
def self.included(model) | |
model.class_eval do | |
extend ActiveModel::Callbacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/boot.rb | |
# ..bottom of file | |
# FROM | |
require 'rails/all' | |
# require "active_model/railtie" | |
# require "active_record/railtie" | |
# require "action_controller/railtie" | |
# require "action_view/railtie" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
# ..other specs | |
gem "mongo_mapper", :git => "git://github.com/jnunemaker/mongomapper.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bike | |
include MongoMapper::Document | |
key :_type, String | |
key :brand, String | |
end | |
class TwoWheeler < Bike | |
key :has_suspension, Boolean | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form_for @post, :remote => true | |
# => | |
# <form action="/posts" id="create-post" method="post" data-remote="true"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct list_item { | |
struct list_item *next; | |
int data; | |
}; | |
typedef struct list_item ListItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Request.HTML({ | |
update: updateElement, | |
onSuccess: function() { | |
rails.applyEvents(updateElement); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (command.is(Command.DoorLocks.LOCK_STATE)) { | |
LockState lockState = (LockState) command; | |
Log.d(TAG, "Car is locked: " + lockState.isLocked()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe(`VehicleLocationCommand`, () => { | |
it(`should get vehicle location`, async () => { | |
const response = await hmkit.telematics.sendCommand( | |
vehicleSerial, | |
hmkit.commands.VehicleLocationCommand.get() | |
); | |
expect(response.parse()).toEqual( | |
expect.objectContaining({ | |
latitude: expect.any(Number), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Great to have seen you all at the meetup. Here's links to the material I used in the talk: | |
WebBluetooth community: https://plus.google.com/communities/108953318610326025178 | |
Intro to Bluetooth Low Energy: https://www.slideshare.net/zdennis/btle-bluetooth-low-energy-and-corebluetooth | |
Current implementation status: https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md | |
Web Bluetooth tutorial: https://developers.google.com/web/updates/2015/07/interact-with-ble-devices-on-the-web |