Skip to content

Instantly share code, notes, and snippets.

View zoernert's full-sized avatar

Thorsten Zoerner zoernert

View GitHub Profile
Verifying I am +zoernert on my passcard. https://onename.com/zoernert
@zoernert
zoernert / gist:9b7f22a3e456dbe9c6ab
Created May 28, 2015 12:51
GoogleApps Script: Label all old Gmails
// Use at: https://script.google.com/
function findOldMails() {
// Find UserLabel (Needs to exist)
var label = GmailApp.getUserLabelByName("old");
// Setting our query
var query="older_than:1y -label:old";
@zoernert
zoernert / microdao.abi
Last active June 19, 2017 10:13
Micro DAO to create an EVU in Germany
[ { "constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string", "value": "MicroDAO" } ], "type": "function" }, { "constant": false, "inputs": [], "name": "executeSpendingRequests", "outputs": [], "type": "function" }, { "constant": false, "inputs": [ { "name": "number_of_days", "type": "uint256" }, { "name": "requiredShares", "type": "uint256" } ], "name": "setDirectorLock", "outputs": [], "type": "function" }, { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "bookings", "outputs": [ { "name": "time", "type": "uint256" }, { "name": "funding", "type": "uint256" }, { "name": "spending", "type": "uint256" }, { "name": "counterpart", "type": "address" }, { "name": "text", "type": "string" } ], "type": "function" }, { "constant": false, "inputs": [], "name": "closeFunding", "outputs": [], "type": "function" }, { "constant": false, "inputs": [ { "name": "node", "type": "string" } ], "name": "setDirectorNode", "outputs": [], "type": "function" }, { "consta
@zoernert
zoernert / fs_blockchain_edifact.js
Created July 10, 2016 20:41
Sample Implementation for EDI style message exchange using Ethereum blockchain for transactions (log messages transferred) and IPFS for message content (encrypted)
/**
Simple file based EDI style message exchange using EDIchain
Will use the following folder structure:
out\ = Place EDI Messages as text files in here (required Recipient in UNB segment)
sent\ = Messages sent and documented in blockchain (filename will be Transaction ID_IPFS-Hash
in\edi = Received EDI Messages (text files)
in\meta = Meta files corresponding to EDI Messages.
{"p01067":{"a":"27.7","g":"118.62"},"p01069":{"a":"27.7","g":"118.62"},"p01097":{"a":"27.7","g":"118.62"},"p01099":{"a":"27.7","g":"118.62"},"p01108":{"a":"27.7","g":"118.62"},"p01109":{"a":"27.7","g":"118.62"},"p01127":{"a":"27.7","g":"118.62"},"p01129":{"a":"27.7","g":"118.62"},"p01139":{"a":"27.7","g":"118.62"},"p01156":{"a":"27.7","g":"118.62"},"p01157":{"a":"27.7","g":"118.62"},"p01159":{"a":"27.7","g":"118.62"},"p01169":{"a":"27.7","g":"118.62"},"p01187":{"a":"26.13","g":"146.85"},"p01189":{"a":"27.7","g":"118.62"},"p01217":{"a":"27.7","g":"118.62"},"p01219":{"a":"27.7","g":"118.62"},"p01237":{"a":"27.7","g":"118.62"},"p01239":{"a":"27.7","g":"118.62"},"p01257":{"a":"27.7","g":"118.62"},"p01259":{"a":"27.7","g":"118.62"},"p01277":{"a":"27.7","g":"118.62"},"p01279":{"a":"27.7","g":"118.62"},"p01307":{"a":"27.7","g":"118.62"},"p01309":{"a":"27.7","g":"118.62"},"p01324":{"a":"27.7","g":"118.62"},"p01326":{"a":"27.7","g":"118.62"},"p01328":{"a":"27.7","g":"118.62"},"p01445":{"a":"24","g":"122.57"},"p01454":
var StromDAONode = new require("./StromDAONode.js");
var node = new StromDAONode.Node({});
// Hole einen GWALink und schreibe einen Messwert
node.gwalink('0xBA2ef7bF8f21218c85c3399025E0d6D63632dc03').then(
function(gwalink) {
var reader_in = gwalink.reader_in;
var reader_out = gwalink.reader_out;
var myReading=new Date().getTime();
pragma solidity ^0.4.10;
/**
* StromDAO Business Objects
* ====================================================================
* Upper level business objects required for power delivery on a public
* energy distribution system. Defines PowerDelivery as digital asset
* used for transaction data and entities (roles) for master data.
*
* @author Thorsten Zoerner <thorsten.zoerner(at)stromdao.de)
**/
### Keybase proof
I hereby claim:
* I am zoernert on github.
* I am thorstenzoerner (https://keybase.io/thorstenzoerner) on keybase.
* I have a public key ASAc7rKmzHWeWyFeq3a5o_S83EBgnW4ryLXjgnTX_3Pgzwo
To claim this, I am signing this object:
### Keybase proof
I hereby claim:
* I am zoernert on github.
* I am thorsten_zoerner (https://keybase.io/thorsten_zoerner) on keybase.
* I have a public key ASBw2XjGvKjX1N3bjppkXX8nOSCAiQytJsA0sqTFlJTDdQo
To claim this, I am signing this object:
@zoernert
zoernert / sendgridstats.js
Created September 16, 2021 22:12
Retrieve Sendgrid Statistics
const sendgridAPIKey = 'YOUR_SENDGRID_API_KEY';
const fromDate = new Date(new Date().getTime() - (7*87600000)).toISOString().split('T')[0]; // last 7 days
const axios = require("axios");
// Retrieve Statistics from Sendgrid
const sendgridStatsResponds = await axios.get("https://sendgrid.com/v3/stats?start_date="+fromDate,{
headers: {
'content-type': 'application/json',
'Authorization': 'Bearer '+sendgridAPIKey