Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

{
"device_id": 562949953534211,
"timestamp": "2016-09-04T15:36:27.637Z",
"data": {
"push": 1
},
"device_properties": {
"appeui": "70b5e59ca0000001",
"decoding_ok": true,
"decryption_ok": true,
/*
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#include "Arduino.h"
void setup()
{
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
@ksahnine
ksahnine / ble-event.json
Created April 17, 2016 15:55
Evènement absence
{
owner: "Kadda SAHNINE",
isNear: false,
addr: "80:71:7A:A9:17:27"
}
import socket
# Peudo code
def notify(tcpHost, tcpPort, device, logger):
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
data = json.dumps(device)
try:
import bluetooth
import yaml
# Pseudo code
def main(argv):
configFile = "devices.yml"
# Loads the configuration file
if os.path.isfile(configFile):
# Delay between 2 BLE discoveries (in seconds)
delay: 4
# Checks the proximity of the following devices
devices:
- owner: Kadda SAHNINE
addr: 80:71:7A:A9:17:27
- owner: Bob L'EPONGE
addr: 18:9E:FC:26:03:55
@ksahnine
ksahnine / RatpWidget.jsx
Last active January 26, 2016 16:53
Widget RATP
import React from 'react';
import {RatpStatusBar} from './RatpStatusBar';
import {RatpHeader} from './RatpHeader';
import './css/ratp-widget.css';
export let RatpWidget = React.createClass({
getInitialState() {
return {
station: "",
destination: "",
@ksahnine
ksahnine / scripts_npm.json
Created January 26, 2016 13:46
Scripts npm
{
...
"scripts": {
"dev": "webpack-dev-server --config webpack.config.js --devtool eval --progress --colors --content-base build"
}
...
}
@ksahnine
ksahnine / index.html
Created January 20, 2016 09:16
Widget RATP : index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<h1>Widget RATP</h1>
<script src="bundle.js"></script>
</body>
</html>