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
import base64 | |
import json | |
import firebase_admin | |
from firebase_admin import db | |
firebase_admin.initialize_app( | |
credential=None, | |
options={'databaseURL' : 'https://YOUR_FIREBASE_DB_NAME.firebaseio.com'}, | |
) |
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
<!DOCTYPE html> | |
<html class="h-100"> | |
<head> | |
<title>Preact with JS3</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css"> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script src="https://unpkg.com/preact"></script> | |
</head> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Preact with JS3</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.1/css/bootstrap.min.css"> | |
<script src="https://unpkg.com/history/umd/history.min.js"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script src="https://unpkg.com/preact"></script> | |
<script src="https://unpkg.com/preact-router"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Preact without Babel or JSX</title> | |
</head> | |
<body> | |
<script src="https://unpkg.com/preact"></script> | |
<script> |
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
function doPost(e) { | |
try { | |
var obj = JSON.parse(e.postData.contents); | |
var doc = SpreadsheetApp.getActiveSpreadsheet(); | |
var name = obj.id || 'DATA'; | |
var sheet = doc.getSheetByName(name); | |
if (!sheet) { | |
doc.insertSheet(name); | |
sheet = doc.getSheetByName(name); | |
range = sheet.getRange("H1:Z1"); |
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
#!/bin/sh | |
DESTDIR=~/esp | |
IDF_PATH=$DESTDIR/esp-idf | |
sudo easy_install pip | |
sudo pip install pyserial | |
mkdir -p $DESTDIR |
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
// Example data upload: | |
// curl -L -H 'Content-Type: application/json' -d '{"id":"sheet1","names":["timestamp","ram"],"points":[[1,2],[3,4]]}' THIS_SCRIPT_URL | |
function doPost(e) { | |
try { | |
var obj = JSON.parse(e.postData.contents); | |
var doc = SpreadsheetApp.getActiveSpreadsheet(); | |
var name = obj.id || 'DATA'; | |
var sheet = doc.getSheetByName(name); | |
if (!sheet) { | |
doc.insertSheet(name); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- jQuery first, then Tether, then Bootstrap JS. --> | |
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> </script> |
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
[ | |
{ | |
"name_pattern": "*", | |
"addr_pattern": "c2:*|01:*", | |
"actions": { | |
"00001530-1212-efde-1523-785feabcd123": { | |
"00001111-2222-3456-6543-785feabcd456": { | |
"notify": { | |
"dst": { "type": "http", "url": "http://127.0.0.1:1234/bt/${name}" } | |
}, |
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
let AWS = { | |
Shadow: { | |
_seth: ffi('void mgos_aws_shadow_set_state_handler_simple(int (*)(userdata, int, char *, char *, char *, char *), userdata)'), | |
_upd: ffi('int mgos_aws_shadow_update_simple(double, char *)'), | |
_scb: function(ud, ev, rep, des, rm, dm) { | |
rep = rep !== "" ? JSON.parse(rep) : {}; | |
des = des !== "" ? JSON.parse(des) : {}; | |
ud.cb(ud.ud, ev, rep, des, rm, dm); | |
}, |