Skip to content

Instantly share code, notes, and snippets.

View tomconte's full-sized avatar
💻
Working from home

Thomas Conté tomconte

💻
Working from home
View GitHub Profile
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceName": {
"type": "String",
"metadata": {
"description": "The name of the Managed Cluster resource."
}
},
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceName": {
"type": "String",
"metadata": {
"description": "The name of the Managed Cluster resource."
}
},
@tomconte
tomconte / tessel_upload_camera_picture.js
Created September 24, 2014 15:19
This Tessel script will take a picture and upload it to Azure Blob Storage. You will first need to generate a Shared Access Signature: http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/
var tessel = require('tessel');
var https = require('https');
// Upload parameters
var blob_host = 'tconeu.blob.core.windows.net';
var blob_container = 'tessel-uploads';
// Use any tool to generate a Shared Access Key e.g. Azure Management Studio
var blob_sas = '?sr=c&sv=2014-02-14&si=tessel&sig=xxxxRv%2xxxxUTd8xxxxMKc0xxxxi%2Fxxxxw6VsxxxxGjdJxxxx';
@tomconte
tomconte / event_hubs_send.py
Last active February 15, 2018 08:54
Send messages to an Azure Event Hub using the Apache Qpid Proton AMQP library.
#!/usr/bin/python
# Send messages to an Azure Event Hub using the Apache Qpid Proton AMQP library.
import sys
import commands
from proton import *
# Event Hub address & credentials
# amqps://<keyname>:<key>@<namespace>.servicebus.windows.net/<eventhubname>
@tomconte
tomconte / ApolloTrade
Created May 24, 2016 14:47 — forked from anonymous/Untitled
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://chriseth.github.io/browser-solidity/#version=soljson-latest.js&optimize=undefined&gist=
contract ApolloTrade {
uint public kWh_rate = 1000;
mapping (address => uint) energyAccount;
mapping (address => uint) coinAccount;
address public owner;
function ApolloTrade() {
owner = msg.sender;
}
@tomconte
tomconte / event_hubs_receive.py
Created December 6, 2014 10:44
Receive messages from an Azure Event Hub using the Apache Qpid Proton AMQP library. Nota bene: in order to receive all messages, you should really subscribe to all your Event Hub partitions. This example shows how to read from a single partition.
#!/usr/bin/python
# Receive messages from an Azure Event Hub using the Apache Qpid Proton AMQP library.
import sys
import commands
import re
import uuid
import serial
from proton import *
Verifying that +tomconte is my blockchain ID. https://onename.com/tomconte
@tomconte
tomconte / Token.sol
Created December 13, 2016 09:37
Super simple Ethereum smart contract for testing.
pragma solidity ^0.4.0;
contract Token {
mapping (address => uint) public balances;
function Token() {
balances[msg.sender] = 1000000;
}
function transfer(address _to, uint _amount) {
@tomconte
tomconte / fix_horus_calendar.py
Last active October 16, 2017 20:29
Corrige le calendrier ICS exporté depuis le module emploi du temps de Educ-Horus.
#!/usr/local/bin/python3
# Corrige le calendrier EducHorus en recopiant le champ DESCRIPTION
# dans le champ SUMMARY pour que les matières apparaissent dans les
# intitulés des évènements.
# Corrige également le fuseau horaire en Europe/Paris.
from dateutil.tz import gettz
from ics import Calendar
@tomconte
tomconte / ams_client.ino
Last active September 4, 2017 17:54
This sample Arduino sketch uploads telemetry data to Azure Mobile Services
/*
** This sample Arduino sketch uploads telemetry data to Azure Mobile Services
** See the full article here: http://hypernephelist.com/2014/07/11/arduino-uno-azure-mobile-services.html
**
** Thomas Conté @tomconte
*/
#include <SPI.h>
#include <Ethernet.h>