Skip to content

Instantly share code, notes, and snippets.

@udooz
udooz / was-auth-scheme.txt
Created November 17, 2012 07:12
WAS Authentication Scheme - Sample request string to sign
GET\n /*HTTP Verb*/
\n /*Content-Encoding*/
\n /*Content-Language*/
\n /*Content-Length*/
\n /*Content-MD5*/
\n /*Content-Type*/
\n /*Date*/
\n /*If-Modified-Since */
\n /*If-Match*/
\n /*If-None-Match*/
@udooz
udooz / was-generate-authheaderstring
Created November 17, 2012 07:27
PowerShell function to generate signed string for WAS Authorization header
function Generate-AuthString
{
param(
[string]$url
,[string]$accountName
,[string]$accountKey
,[string]$requestUtcTime
)
@udooz
udooz / cloudBlobClient
Created November 20, 2012 10:01
cloudBlobClient and AuthKey Issue
var ContainerName = "aContainer";
var creds = "DefaultEndpointsProtocol=http;AccountName=accName;AccountKey=hidden";
var sourceAccount = Microsoft.WindowsAzure.CloudStorageAccount.Parse(creds);
var cloudBlobClient = new Microsoft.WindowsAzure.StorageClient.CloudBlobClient(sourceAccount.BlobEndpoint.ToString());
var blobContainer = cloudBlobClient.GetContainerReference(ContainerName);
try
{
blobContainer.FetchAttributes();
var ContainerName = "aContainer";
var creds = "DefaultEndpointsProtocol=http;AccountName=accName;AccountKey=hidden";
var sourceAccount = Microsoft.WindowsAzure.CloudStorageAccount.Parse(creds);
var cloudBlobClient = new Microsoft.WindowsAzure.StorageClient.CloudBlobClient(sourceAccount.BlobEndpoint.ToString(), sourceAccount.Credentials);
var blobContainer = cloudBlobClient.GetContainerReference(ContainerName);
try
{
blobContainer.FetchAttributes();
[string] $xmlContent = get-Content "$XmlFilePath";
if(!$xmlContent -imatch "<schedulerjob\s*?xmlns=['""]http:\/\/tempuri\.org\/XMLSchema\.xsd['""]>")
{
Write-Host "your error message";
exit;
}
[xml] $xml = $xmlContent;
System.Xml
System.Xml.Schema
System.IO
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add("http://tempuri.org/XMLSchema.xsd", @"SchedulerJob.xsd");
XDocument doc = XDocument.Load(@"restoretable.xml");
string msg = "";
doc.Validate(schemas, (o, e) => {
public class ProfileDetails
{
[DataMember]
public string FirstName
{
get;
set;
}
[DataMember]
@udooz
udooz / gist:306c8c80717b24e2fb2e
Last active August 29, 2015 14:24
exploring ardunio parts catalog snippet
<div class="page-list page-list-ext ">
<div class="page-list-ext-item"><div class="page-list-ext-image"><a href="http://exploringarduino.com/parts/p1uf-cap/?iframe=true" rel="prettyPhoto" "="" title=".1uF Electrolytic Capacitor"><img src="//exploringarduino.com/wp-content/uploads/2013/06/1uF-capacitor.jpg" width="150" alt=".1uF Electrolytic Capacitor"></a></div> <h3 class="page-list-ext-title"><a href="http://exploringarduino.com/parts/p1uf-cap/?iframe=true" rel="prettyPhoto" "="" title=".1uF Electrolytic Capacitor">.1uF Electrolytic Capacitor</a></h3></div>
<div class="page-list-ext-item"><div class="page-list-ext-image"><a href="http://exploringarduino.com/parts/100-ohm-resistor/?iframe=true" rel="prettyPhoto" "="" title="100 ohm Resistor"><img src="//exploringarduino.com/wp-content/uploads/2013/06/100-ohm-resistor-400x400.jpg" width="150" alt="100 ohm Resistor"></a></div> <h3 class="page-list-ext-title"><a href="http://exploringarduino.com/parts/100-ohm-resistor/?iframe=true" rel="prettyPhoto" "="" title="
using System;
using System.Collections.Generic;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Confluent.Kafka;
namespace BananaEater