Skip to content

Instantly share code, notes, and snippets.

@ChrisBriggsy
ChrisBriggsy / MainPage.xaml.cs
Created April 3, 2016 07:21
Getting Started Developing UWP apps for Xbox One - Step 5. Adding the code behind
using Newtonsoft.Json;
using System.Net.Http;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
namespace IoTBackUp
{
public sealed partial class MainPage : Page
{
public MainPage()
@ChrisBriggsy
ChrisBriggsy / MainPage.xaml
Created April 3, 2016 07:19
Getting Started Developing UWP apps for Xbox One - Step 3. Update mainpage.xaml
<Page
x:Class="IoTBackUp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:IoTBackUp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@ChrisBriggsy
ChrisBriggsy / greeter.ts
Created December 1, 2015 05:01
Getting Started with Gulp - Add some TypeScript - https://github.com/SSWConsulting/training-content
class Greeter {
constructor(public greeting: string) { }
greet() {
return "<h1>" + this.greeting + "</h1>";
}
};
var greeter = new Greeter("Hello, world!");
document.body.innerHTML = greeter.greet();
@ChrisBriggsy
ChrisBriggsy / ISparkFunWeatherSheild.cs
Created September 8, 2015 10:32
Setting up Dependency Injection for Windows Universal Platform using Autofac - Step 2 - Extrat interface
using System.Threading.Tasks;
namespace SparkFun
{
internal interface ISparkFunWeatherSheild
{
float Humidity { get; }
float Temperature { get; }
Task<bool> Setup();
}
@ChrisBriggsy
ChrisBriggsy / DesktopWeather.cs
Last active September 8, 2015 10:28
Setting up Dependency Injection for Windows Universal Platform using Autofac - Step 3 - Create a desktop compatible version
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using SparkFun;
namespace IoTBackUp
{
internal class DesktopWeather : ISparkFunWeatherSheild
{
@ChrisBriggsy
ChrisBriggsy / MainPage.xaml.cs
Last active September 8, 2015 10:22
Setting up Dependency Injection for Windows Universal Platform using Autofac - Step 6 - Wiring it all up
using System;
using System.Collections.Generic;
using System.Net.Http;
using Windows.UI.Xaml.Controls;
using Autofac;
using SparkFun;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace IoTBackUp
@ChrisBriggsy
ChrisBriggsy / query
Created September 4, 2015 09:20
How to connect Application Insights to Power BI via Azure Stream Analytic - Step 10 - Set the query
SELECT
flatEvent.ArrayValue.name,
count(flatEvent)
INTO
[SSWTimePro-Appinsights]
FROM
[export-input] A
OUTER APPLY GetElements(A.[event]) as flatEvent
GROUP BY TumblingWindow(minute, 1), flatEvent.ArrayValue.name
@ChrisBriggsy
ChrisBriggsy / tsd.json
Created August 25, 2015 02:25
Gulp 101 - Automatically update your TypeScript definitions in Visual Studio 2015 - 4. Write the Configuration file for tsd
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"angularjs/angular.d.ts": {
"commit": "c5a2f44bab06cf9f2bcc14530171daac1cebff6c"
}
@ChrisBriggsy
ChrisBriggsy / gulp_tsd.json
Created August 25, 2015 02:23
Gulp 101 - Automatically update your TypeScript definitions in Visual Studio 2015 - 3. Create the setting file for gulp_tsd plugin.
{
"command": "reinstall",
"latest": true,
"config": "./tsd.json",
"opts": {
}
}
@ChrisBriggsy
ChrisBriggsy / gulpfile.js
Created August 25, 2015 02:22
Gulp 101 - Automatically update your TypeScript definitions in Visual Studio 2015 - 2. Add the gulp task (gulpfile.js)
var gulp = require('gulp');
var tsd = require('gulp-tsd');
gulp.task('tsd', function () {
return gulp.src('./gulp_tsd.json').pipe(tsd());
});