Skip to content

Instantly share code, notes, and snippets.

device.gatt.connect()
.then(server => {
server.getPrimaryService('ce060030-43e5-11e4-916c-0800200c9a66') // Rowing Service.
.then(rowingService => {
// ...
});
});
const options = {
filters: [{services: ['ce060000-43e5-11e4-916c-0800200c9a66']}],
optionalServices: [
'ce060010-43e5-11e4-916c-0800200c9a66', // Information Service.
'ce060020-43e5-11e4-916c-0800200c9a66', // Control Service.
'ce060030-43e5-11e4-916c-0800200c9a66' // Rowing Service.
]
};
navigator.bluetooth.requestDevice(options)
.then(device => {
const options = {
filters: [{services: ['ce060000-43e5-11e4-916c-0800200c9a66']}],
optionalServices: [
'ce060010-43e5-11e4-916c-0800200c9a66', // Information Service.
'ce060020-43e5-11e4-916c-0800200c9a66', // Control Service.
'ce060030-43e5-11e4-916c-0800200c9a66' // Rowing Service.
]
};
navigator.bluetooth.requestDevice(options)
.then(device => {
<!-- Defines element markup -->
<template id="gigya-comments-template">
<style>
.comment {
margin-bottom: 20px;
}
.author {
display: block;
font-style: italic;
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<link rel="canonical" href="./amp-form-sub.html">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility
/**
* Copyright 2015-2016, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
curl -X POST -H "Authorization: key=<Firebase Auth Key>" -H "Content-Type: application/json" -d '{
"notification": {
"title": "A Notification to My Topic",
"body": "Add more information to your notification here!",
"icon": "https://www.example.com/my-notification-icon.png",
"click_action": "https://www.example.com/url-to-open-from-notification.html"
},
"to": "/topics/my-topic"
}' "https://fcm.googleapis.com/fcm/send"
curl -X POST -H "Authorization: key=<Firebase-Auth-Key>" -H "Content-Type: application/json" -d '{
"to": "/topics/test",
"registration_tokens": ["User-FCM-Token"]
}' "https://iid.googleapis.com/iid/v1:batchRemove"
@andreban
andreban / topic-subscribe.sh
Created January 5, 2017 10:46
Subscribing to a Firebase Topic
curl -X POST -H "Authorization: key=<Firebase Auth Key>" -H "Content-Type: application/json" -d '{}' "https://iid.googleapis.com/iid/v1/<User-FCM-Token>/rel/topics/my-topic"
@andreban
andreban / manifest.json
Last active December 16, 2016 17:34
Tracking home screen traffic
{
"name": "PWA Directory",
"short_name": "PWA Directory",
"description": "A Directory of PWAs",
"//": "Append tracking parameters to start_url",
"start_url": "/?utm_source=homescreen",
"..."
}