Skip to content

Instantly share code, notes, and snippets.

View chgeuer's full-sized avatar
🏠
Working from Düsseldorf

Dr. Christian Geuer-Pollmann chgeuer

🏠
Working from Düsseldorf
View GitHub Profile
@chgeuer
chgeuer / SelfHostWithAssembliesResolver.cs
Created June 15, 2012 13:29 — forked from HenrikFrystykNielsen/SelfHostWithAssembliesResolver.cs
ASP.NET Web API: Controlling assemblies loaded by providing own AssembliesResolver
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using System.Web.Http.SelfHost;
namespace SelfHost
{
@chgeuer
chgeuer / PersonalausweisAbholen.cs
Created June 25, 2012 19:00
Prüfen, ob mein Personalausweis da ist...
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace CardStatus
{
class Program
{
static void RunCheck(int antragsnummer)
{
@chgeuer
chgeuer / PatchIncorrectMimeTypesProgram.cs
Created July 10, 2012 22:05
Windows Azure Storage - Patch incorrect/missing MIME types
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
class PatchIncorrectMimeTypesProgram
{
static void recurse(IListBlobItem blobItem, Action<CloudBlockBlob> action)
{
@chgeuer
chgeuer / PlayingWithAzureTableSAS.cs
Created July 31, 2012 12:24
Using a shared access signature for a table
using System;
using System.Data.Services.Client;
using System.Data.Services.Common;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
namespace PlayingWithAzureTableSAS
{
class Program
@chgeuer
chgeuer / FixMyMimetypes.cs
Created August 7, 2012 10:16
Fix the MIME types in a blob folder
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
namespace ConsoleApplication1
{
class Program
{
@chgeuer
chgeuer / CopyBlob.cs
Created August 24, 2012 13:06
Copy blobs in Azure
using System;
using System.Data.Services.Client;
using System.Data.Services.Common;
using System.Linq;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;
using System.Threading;
namespace CopyBlobsViaAPI
{
@chgeuer
chgeuer / Windows8ZoomLevel.cs
Created August 29, 2012 15:12
Change zoom level in a Windows 8 WebView control by injecting JavaScript
zoomLevel.TextChanged += (s, e) =>
{
Func<WebView, double, bool> zoom = (wv, zoomPercentage) =>
{
var script = string.Format(
"(function () {{ document.styleSheets[0]['rules'][0].style['zoom'] = {0}; }})();", zoomPercentage);
try
{
var result = wv.InvokeScript("eval", new string[] { script });
@chgeuer
chgeuer / sample.cs
Created August 29, 2012 19:49
Async/await for WindowsRuntimeComponents
namespace WindowsRuntimeComponent1
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Windows.Foundation;
public interface IDoStuff
{
IAsyncAction DoItAsync();
@chgeuer
chgeuer / backupToAzure.ps1
Created August 30, 2012 08:12
Simple backup skript for uploading to Azure
# Given as free as possible: MS-PL
$accountname = "azureaccountname";
$accountkey = [System.IO.File]::ReadAllText(".\accountkey.txt");
$backupcontainername = "backup";
$dllpath = [System.IO.Path]::Combine([System.Environment]::CurrentDirectory, "Microsoft.WindowsAzure.StorageClient.dll")
$loadresult = [Reflection.Assembly]::LoadFile($dllpath);