Skip to content

Instantly share code, notes, and snippets.

/**
* @reference https://github.com/myDevicesIoT/cayenne-docs/blob/master/docs/LORA.md
* @reference http://openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html#extlabel
*
* Adapted for lora-app-server from https://gist.github.com/iPAS/e24970a91463a4a8177f9806d1ef14b8
*
* Type IPSO LPP Hex Data Size Data Resolution per bit
* Digital Input 3200 0 0 1 1
* Digital Output 3201 1 1 1 1
* Analog Input 3202 2 2 2 0.01 Signed
@VanitySoft
VanitySoft / queryByFeatureCollectionResponse.geojson
Created April 19, 2019 13:58
Query By FeatureCollection Response
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
package com.vanitysoft.morgua;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.StringUtils;
import org.himalay.cayenne.LPPDataFactory;
@VanitySoft
VanitySoft / 12042.geojson
Created October 30, 2018 21:04
12042 zipcode
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[1535.4699999999998,40.83999999999992],[1504.5469831641346,354.80665883343573],[1412.966286851714,656.7077550424335],[1264.247305862978,934.9413988077664],[1064.1052272347583,1178.8152272347581],[820.2313988077666,1378.957305862978],[541.9977550424335,1527.676286851714],[240.0966588334358,1619.2569831641347],[-73.87000000000002,1650.1799999999998],[-387.8366588334358,1619.2569831641347],[-689.7377550424336,1527.676286851714],[-967.9713988077663,1378.9573058629783],[-1211.8452272347583,1178.8152272347584],[-1411.9873058629785,934.9413988077664],[-1560.7062868517141,656.7077550424336],[-1652.2869831641349,354.8066588334363],[-1683.21,40.84000000000012],[-1652.2869831641349,-273.12665883343607],[-1560.7062868517144,-575.0277550424335],[-1411.9873058629785,-853.2613988077662],[-1211.8452272347588,-1097.1352272347583],[-967.9713988077666,-1297.2773058629782],[-689.7377550424345,-1445.9962868517139
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(
"https://vanitysoft-boundaries-io-v1.p.mashape.com/reaperfire/rest/v1/public/boundary?and=true&state=TX");
httpGet.setHeader("X-Mashape-Key", "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
httpGet.setHeader("Accept", "application/json");
CloseableHttpResponse response = httpclient.execute(httpGet);
Assert.assertTrue(Integer.toString(response.getStatusLine().getStatusCode()),
response.getStatusLine().getStatusCode() == 200);
FileUtils.writeByteArrayToFile(new File("TX-production-Httpclient.json"),
IOUtils.toByteArray(response.getEntity().getContent()));