Skip to content

Instantly share code, notes, and snippets.

View bittailor's full-sized avatar

Franz Schnyder bittailor

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Bockmattli via Fällätschen</name>
<visibility>1</visibility>
<open>1</open>
<Style id="red">
<LineStyle>
<color>C81400FF</color>
@bittailor
bittailor / manifest.json
Created December 20, 2018 21:57
particle.particle-vscode-core - src/compiler/toolchain/manifest.json
{
"version": "1.0.0",
"toolchains": [
{
"platforms": [12, 13, 14],
"firmware": "deviceOS@0.8.0-rc.27",
"compilers": "gcc-arm@5.3.1",
"tools": "buildtools@1.0.1",
"scripts": "buildscripts@1.0.1"
},
@bittailor
bittailor / wget.js
Created October 8, 2018 10:01
a simple and incomplete wget for node
const fs = require('fs');
const fetch = require('node-fetch');
const progress = require('progress-stream');
const crypto = require('crypto');
function wgetNext(url, progStrem, hash, tracking, retry) {
console.log(`bt-wgetNext length=${tracking.length} pipedLength=${tracking.pipedLength} retry=${retry}`);
const options = {
headers: {
Range: `bytes=${tracking.pipedLength}-${tracking.length}`
@bittailor
bittailor / main.cpp
Created January 4, 2017 20:29
bt-mbed-bug-ticker
#include "mbed.h"
DigitalOut led(LED1,0);
Ticker sTicker1;
int sTick1;
void tick1() {
sTick1++;
}
#include <Wire.h>
#include <IPStack.h>
#include <Countdown.h>
#include <MQTTClient.h>
#include <Adafruit_INA219.h>
#include "GPRSClient.h"
SoftwareSerial sSoftwareSerial(7,8);
GPRSClient sGprsClient(sSoftwareSerial,9);
#include <IPStack.h>
#include <Countdown.h>
#include <MQTTClient.h>
#include "GPRSClient.h"
SoftwareSerial sSoftwareSerial(7,8);
GPRSClient sGprsClient(sSoftwareSerial,9);
IPStack sIpStack(sGprsClient);
MQTT::Client<IPStack, Countdown, 50, 1> sMqttClient = MQTT::Client<IPStack, Countdown, 50, 1>(sIpStack);
#include "GPRSClient.h"
GPRSClient::GPRSClient(Stream& pStream, uint8_t pPowerPin) : mStream(pStream), mPowerPin(pPowerPin) , mConnected(false) {
}
void GPRSClient::begin(const char* pin, const char* apn) {
pinMode(mPowerPin, OUTPUT);
digitalWrite(mPowerPin, LOW);
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
SoftwareSerial gprsSerial(7, 8);
Adafruit_PCD8544 display = Adafruit_PCD8544(3, 4, 5);
String readAnswer() {
package ch.bittailor.iot.mqttsn.gateway;
import jdk.dio.DeviceManager;
import jdk.dio.gpio.GPIOPin;
import org.osgi.service.component.ComponentContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LedHelloWorld {