Skip to content

Instantly share code, notes, and snippets.

View robinmanuelthiel's full-sized avatar
✌️
Never grow up!

Robin-Manuel Thiel robinmanuelthiel

✌️
Never grow up!
View GitHub Profile
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en" Name="CortanaCommands_en">
<CommandPrefix>Switch the light</CommandPrefix>
<Example>Switch the light in the bathroom on.</Example>
<Command Name="switchLight">
<Example>in the bathroom on</Example>
<ListenFor>in [the] {room} {status}</ListenFor>
<Feedback>{room}light will be switched {status}.</Feedback>
<Navigate />
// Register Cortana voice commands
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///CortanaCommands.xml"));
await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(file);
Windows.ApplicationModel.VoiceCommands.VoiceCommnadDefinition.VoiceCommandSet commandSet;
if (Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstalledCommandSets.TryGetValue("CortanaCommands_en", out commandSet))
{
await commandSetEnUs.SetPhraseListAsync("room", new string[] {"Bathroom", "Kitchen", "Livingroom", "Bedroom"});
}
protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
string infos = string.Empty;
// Get voice data
if (args.Kind == ActivationKind.VoiceCommand)
{
var commandArgs = args as VoiceCommandActivatedEventArgs;
var speechRecognitionResult = commandArgs.Result;
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (!string.IsNullOrEmpty(e.Parameter as string))
{
// Check if all paramters for accessing the light are set
if (App.HomeMatic != null && App.SelectedLightId != 0)
{
var args = ((string)e.Parameter).Split('|');
<Application
x:Class="App1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
RequestedTheme="Light">
<Application.Resources>
<!-- The custom color for the new placeholder -->
<SolidColorBrush x:Key="MyCustomPlaceholderForegroundColor" Color="{StaticResource SystemBaseHighColor}"/>
@robinmanuelthiel
robinmanuelthiel / ArduinoMarquee.ino
Created August 17, 2016 16:16
A simple Arduino Sketch to let a marquee run through a LED panel.
// Use LiquidCrystal library to communicate with LCD
#include <LiquidCrystal.h>
// Select the pins used on the LCD panel
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Define message to show
String message = "My future tweets will be in this format";
void setup() {
@robinmanuelthiel
robinmanuelthiel / ArduinoLcdKeypadControl.ino
Last active August 17, 2016 22:19
A simple Arduino Sketch to control the LCD Keypad Shield (SKU: DFR0009)
// Use LiquidCrystal library
#include <LiquidCrystal.h>
// Define button values
#define btnNONE 0
#define btnRIGHT 1
#define btnUP 2
#define btnDOWN 3
#define btnLEFT 4
@robinmanuelthiel
robinmanuelthiel / EventHubService.cs
Created October 8, 2016 15:36
Connect to an Azure Event Hub manually
using DachauTemp.Windows.Models;
using Newtonsoft.Json;
using System;
using System.Globalization;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
@robinmanuelthiel
robinmanuelthiel / MainPage.xaml
Created February 16, 2017 14:36
Custom Xamarin.Forms Menu Item
<?xml version="1.0" encoding="utf-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ZeissCantinaMenuSample"
x:Class="ZeissCantinaMenuSample.ZeissCantinaMenuSamplePage">
<local:MenuItem x:Name="TestMenuItem" Text="Hallo" Image="AlertIcon.png" Clicked="TestMenuItem_Clicked" />
</ContentPage>