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 / BlockBlobStorage.cs
Created December 6, 2012 05:44
Shows how to upload a block blob to Windows Azure Storage via REST, including methods to compute Signature
using System;
using System.Globalization;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
namespace App5.Storage
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
/// <summary>
/// Modifica los textos en los botones de un MessageBox
/// </summary>
@JuanKRuiz
JuanKRuiz / BindableBase.cs
Last active January 18, 2016 01:04
BindableBase class used in WinRT App development
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace System.ComponentModel
{
public class BindableBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public bool SetProperty<T>(ref T propertyBackStore, T newValue, [CallerMemberName] string propertyName = "")
@JuanKRuiz
JuanKRuiz / TwitterAzureMobileServices.js
Last active December 16, 2015 16:10
This code shows how to query twitter API and send notifications to "Windows 8" App using "Windows Azure Mobile Services"
function insert(item, user, request) {
var httpRequest = require('request');
var url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name='+item.text+'&count=3';
httpRequest(
url,AnalyzeContent
);
request.execute();
@JuanKRuiz
JuanKRuiz / SettingsWindowHelper.cs
Created November 21, 2012 05:53
Helper to easy implement a Settings Charm Style Window
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
/// <summary>Helper to easy implement a Settings Charm Style Window</summary>
public class SettingsWindowHelper
{
/// <summary>Default Window Size</summary>
public const double DEFAULT_WIDTH = 346;
@JuanKRuiz
JuanKRuiz / App.xaml
Created October 29, 2012 14:53
Parte 7 - Tutorial App Lector RSS
<Application
x:Class="RSSJuanK4Blog.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:RSSJuanK4Blog">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
@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: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
@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 / App.xaml.cs
Created July 29, 2014 00:03
Código relacionado con el post "WebAuthenticationBroker y métodos AndContinue | C#" http://juank.io/windows-phone-webauthenticationbroker-metodos-andcontinue/
//Code to add into app.xaml.cs
//this file must be previously generated by Visual Studio 2013 templated project
ContinuationManager _myContinuationManager = new ContinuationManager();
protected async override void OnActivated(IActivatedEventArgs args)
{
CreateRootFrame();