This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
// Alternative (not related to this code, but in case you want to serialize to XML | |
// instead): http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/5d08bc28-5b61-4c5a-8c4b-4665b1c929ea/ | |
// Usage example | |
// NOTE: The Windows Azure CloudQueueMessage constructor accepts either a string | |
// or a byte array. If a byte array is passed in, it is Base64 encoded. | |
// Base64 encoding results in approx a 1/3 payload size penalty (so the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.WindowsAzure.StorageClient; | |
/// <summary> | |
/// Ensure that blobContainer exists before this method returns. | |
/// There is no timeout or maximum time for which this method can run. | |
/// </summary> | |
/// <param name="blobContainer">The (possibly not-yet-created) blob container.</param> | |
/// <param name="options">Required options for blob creation.</param> | |
/// <param name="retryDelay">Optional. Control how long to sleep between creation attempts.</param> | |
/// <returns>If success, just returns. Otherwise, exception is thrown.</returns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<iframe | |
width="100%" | |
src="http://pop.blob.core.windows.net/popstats/last-github-commit.txt" | |
frameborder="0" | |
scrolling="no" | |
name="lastGithubCommit" | |
title="Last Github commit."/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POST /api/githubpushes | |
// FAILS: Content-Type: application/json | |
// WORKS: Content-Type: application/x-www-form-urlencoded | |
public HttpResponseMessage<string> Post( | |
// not needed, but might be if more complex: [FromBody] | |
SimpleFormData webHookData) | |
{ | |
var pushManifestJson = webHookData.Payload; | |
var pushManifest = JsonConvert.DeserializeObject<GithubPushManifest>(pushManifestJson); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .gitignore for ASP.NET MVC / Windows Azure development | |
# Original file: https://gist.github.com/3318347 by @codingoutloud | |
## Github doc on ignoring files: https://help.github.com/articles/ignoring-files | |
## The man page for .gitignore (referenced by github): http://man.cx/gitignore | |
## Of possible interest (can be complex): https://github.com/github/gitignore | |
# Troubleshooting | |
# 1. If you add a .gitignore file to an existing repo (or significantly change one), you may want | |
# to force it to act as though the new/updated .gitignore was in force the whole time. | |
## http://stackoverflow.com/questions/1139762/gitignore-file-not-ignoring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem - Generate a self-signed certificate useful for use with the Windows Azure Service Management API | |
if .%1.==.. goto USAGE | |
if .%2.==.. goto USAGE | |
if "%3"=="-private" goto PRIVATE | |
makecert.exe -r -pe -n %1 -ss My -sky exchange -sp "Microsoft Enhanced RSA and AES Cryptographic Provider" -sy 24 %2.cer | |
goto END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple approach, usually done in RoleEntryPoint::OnStart - though could be otherwise (even done remotely) | |
// See full working project at https://github.com/codingoutloud/SimpleWAD | |
public override bool OnStart() | |
{ | |
Trace.Listeners.Add(new DiagnosticMonitorTraceListener()); | |
Trace.AutoFlush = true; | |
Trace.TraceInformation("Error"); | |
// Set up to transfer to blob storage | |
DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
The beginnings of some useful context to display so one might understand some simple things about a | |
Windows Azure deployment without a lot of effort | |
Source: https://gist.github.com/3829053 | |
--> | |
<!-- | |
As might be included in an About page: | |
Note: only useful when run within a custom assembly; if run from within default.cshtml on, say, trivial | |
Windows Azure Web Sites site, it would show the About info for mscorlib, such as: | |
Last compiled: Saturday, January 21, 2012 at 5:40:04 PM UTC, File version: 4.0.0.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!-- Source: https://gist.github.com/3829717 --> | |
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> | |
<connectionStrings> | |
<add name="NameOfConnectionStringNeedsToMatchWhatsInRegularWebConfig" | |
connectionString= | |
"Server=tcp:abcd12hdj.database.windows.net,1433;Database=pop-tart;User ID=hopefullynonadminuser@abcd12bhdj;Password=TopSecretPassw0rd;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" | |
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> | |
</connectionStrings> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem - Generate a self-signed certificate (*.cer) useful for use with the Windows Azure Service Management API. | |
rem - Optionally create Private Key (*pvk) and Personal Information Exchange (*.pfx) files. | |
rem - A more advanced version of https://gist.github.com/3767941 | |
rem - Assumes the makecert.exe and pvk2pfx.exe are available in your path on Windows. | |
rem - SOURCE: https://gist.github.com/3948621 | |
if .%1.==.. goto USAGE | |
if .%2.==.. goto USAGE | |
if "%3"=="-private" goto PRIVATE |
OlderNewer