Skip to content

Instantly share code, notes, and snippets.

View kevinvaldek's full-sized avatar

Kevin Valdek kevinvaldek

View GitHub Profile
info:
title: HM REST Auto API
description: "High Mobility REST Auto API Level 10 specification"
version: 2.0.0
swagger: '2.0'
host: sandbox.rest-api.high-mobility.com
basePath: /v2
@kevinvaldek
kevinvaldek / Web Bluetooth + Phoenix Channels
Created November 10, 2017 13:26
elixir-meetup-berlin-november-2018
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
@kevinvaldek
kevinvaldek / vehicle-location.js
Created September 23, 2017 14:19
HMKit Node.js vehicle location example
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),
if (command.is(Command.DoorLocks.LOCK_STATE)) {
LockState lockState = (LockState) command;
Log.d(TAG, "Car is locked: " + lockState.isLocked());
}
new Request.HTML({
update: updateElement,
onSuccess: function() {
rails.applyEvents(updateElement);
}
});
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct list_item {
struct list_item *next;
int data;
};
typedef struct list_item ListItem;
form_for @post, :remote => true
# =>
# <form action="/posts" id="create-post" method="post" data-remote="true">
class Bike
include MongoMapper::Document
key :_type, String
key :brand, String
end
class TwoWheeler < Bike
key :has_suspension, Boolean
end
# Gemfile
# ..other specs
gem "mongo_mapper", :git => "git://github.com/jnunemaker/mongomapper.git"
# 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"