Skip to content

Instantly share code, notes, and snippets.

View mbrit's full-sized avatar

Matthew Reynolds (@mbrit) mbrit

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
namespace matzoeffectiveo
{
class Program
namespace Foo
{
public static MyExtensions
{
public static void AddRange<T>(this IList<T> list, IEnumerable<T> items)
{
foreach(var item in items)
list.Add(item);
}
}
@mbrit
mbrit / gist:3898350
Created October 16, 2012 09:39
sdfsdf
sdfdsf
@mbrit
mbrit / gist:3748260
Created September 19, 2012 07:52
xkcd Click and Drag tile downloader
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
namespace XkcdFoo
{
@mbrit
mbrit / gist:3658718
Created September 6, 2012 17:20
StreetFoo language strings
Thanks for helping!
In my book we talk about "problem reports". The idea here is that someone has gone out and found graffiti in the local environment and taken pictures of them. They are presented on a page in the application.
In the application they are called "Reports".
There are four strings:
- Reports
- Reports refreshed.
public MainPage()
{
this.InitializeComponent();
GetItems<List<Object>>("ms-appx:///Common/data.js");
}
private async Task GetItems<T>(string path)
{
// do this in one hit...
@mbrit
mbrit / gist:3635562
Created September 5, 2012 11:54
MetroLog usage
public static class LocationHelper
{
public static async Task<LocationResult> GetCurrentLocationAsync()
{
try
{
var locator = new Geolocator();
var position = await locator.GetGeopositionAsync();
// return...