Skip to content

Instantly share code, notes, and snippets.

@trieb
trieb / gatts_table_profile.h
Created April 25, 2019 12:01
GATT server example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
///Attributes State Machine
//enum
//{
// IDX_SVC, //service w/ UUID
@trieb
trieb / gatts_table_profile.c
Created April 25, 2019 12:01
GATT table description example
#include "gatts_table_profile.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "esp_bt.h"
@trieb
trieb / receive_forecast.php
Created July 25, 2017 09:57
Post data from javascript to php-script (example using api and data from openweathermap.org)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php
// Now to something with the data (don't forget error checking and filtering...)
echo "<h4>Forecast</h4>";
@trieb
trieb / gitdemo.md
Last active May 29, 2017 09:14
Git basics

Create new file, commit and push to GitHub

  1. Add new file file.php
  2. Add some text to file and save.
  3. Stage file to git $ git add file.php
  4. Commit file and add message $ git commit -m "Added new file to repo."
  5. Push file to GitHub $ git push origin
[user]
email = name@post.com
name = My Name
[gui]
recentrepo = C:/git
[push]
default = simple
[core]
@trieb
trieb / irma_2016-10-25.txt
Created October 25, 2016 07:36
Irmas saga 2016-10-25
2016-10-25
DET VAR EN GÅNG EN PRINS ÅCH PRINSESA
HON VAR EN MYKE UNG FLIKA
MEN EN DAG DAG VAR PRINSEN BÅRTA
PRINSEN LÅG ÅKSÅV
SNIP SNAP SLUT
@trieb
trieb / esp_ap.cpp
Created September 1, 2016 14:28
Arduino ESP8266 Wifi AP and client with reconnect
//A simplified version of work begun by Tzapu and chriscook8
//for saving local WiFi SSID and Passwords to the ESP8266.
//Uses ESP8266 internal memory instead of the problematic EEPROM.
//To input local SSID and Password, connect to WiFi "ESP8266",
//and point your browser to "192.168.4.1".
#include "ESP8266WiFi.h"
#include <ESP8266mDNS.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp8266.h>
print("Hello Gistery!")
# Instructions
## Content
1. Install OS
2. Connecting to the Pi
3. Setting up Raspian
4. Enable secure login
5. Install openHAB
6. Install mosquitto
@trieb
trieb / python_plot_days.py
Last active April 1, 2016 11:50 — forked from anonymous/python_plot_days.py
Plot the difference in days between dates in a list
from datetime import datetime
import matplotlib.pyplot as plt
# TODO: Use plotly instead of matplotlib
# See: https://plot.ly/python/bar-charts/
date_format = '%Y-%m-%d'
dates = []