Skip to content

Instantly share code, notes, and snippets.

View JuanKRuiz's full-sized avatar

Juan Carlos Ruiz Pacheco JuanKRuiz

View GitHub Profile
@JuanKRuiz
JuanKRuiz / #2.xml
Created October 20, 2012 09:50
Basic UI Style - Tutorial App Lector RSS
<common:LayoutAwarePage
x:Name="pageRoot"
x:Class="RSSJuanK4Blog.View.RssMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RSSJuanK4Blog.View"
xmlns:common="using:RSSJuanK4Blog.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
@JuanKRuiz
JuanKRuiz / gist:3883319
Created October 13, 2012 05:11
Extracts the first image Url from a html string
/// <summary>Regular expression to get image urls from a HTML string</summary>
private const string STR_IMGTAG_SRC_EXP = @"<img\s+[^>]*\bsrc\s*\=\s*[\x27\x22](?<Url>[^\x27\x22]*)[\x27\x22]";
/// <summary>
/// Extracts the first image Url from a html string
/// </summary>
/// <param name="htmlString">A string containing html code</param>
/// <returns>a collection with the image Urls contained in htmlString parameter</returns>
/// <remarks>This method uses regular expressions,so using System.Text.RegularExpressions;
/// must be addeed</remarks>
@JuanKRuiz
JuanKRuiz / gist:3883275
Created October 13, 2012 04:53
Detects Internet Conectivity in WinRT
/// <summary>
/// Detects Internet Access Connectivity in WinRT
/// </summary>
/// <remarks>
/// This is a Property to put into a class
/// requires using Windows.Networking.Connectivity;
/// </remarks>
public static bool InternetConectivity
{
get