Skip to content

Instantly share code, notes, and snippets.

View RichardSlater's full-sized avatar
🏠
Working from home

Richard Slater RichardSlater

🏠
Working from home
View GitHub Profile
@RichardSlater
RichardSlater / FindAndReplaceInAzureBlob.cs
Created November 24, 2012 16:42
Find any string and replace with any other string in an Azure Table Storage Blob
var accountName = Properties.Settings.Default.StorageAccountName;
var accountKey = Properties.Settings.Default.AccessKey;
var containerName = Properties.Settings.Default.ContainerName;
var blobName = Properties.Settings.Default.Blob;
var credentials = new StorageCredentials(accountName, accountKey);
var account = new CloudStorageAccount(credentials, useHttps: true);
var client = account.CreateCloudBlobClient();
var container = client.GetContainerReference(containerName);
@RichardSlater
RichardSlater / underwater.js
Created October 9, 2012 18:16
Unity3d Underwater Effect
//This script enables underwater effects. Attach to main camera.
//Define variables
var underwaterLevel = 7;
//The scene's default fog settings
private var defaultFog;
private var defaultFogColor;
private var defaultFogDensity;
private var defaultSkybox;
@RichardSlater
RichardSlater / BulkEditCheckBoxExtensions.cs
Created October 2, 2012 10:49
MVC3 Bulk Edit Checkbox HtmlHelper
public static class BulkEditCheckBoxExtensions
{
public static MvcHtmlString BulkEditCheckBoxFor<TModel, TProperty>(
this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression)
where TModel : IBulkEditViewModel
{
var metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData);
var model = htmlHelper.ViewData.Model as IBulkEditViewModel;
var modelPropertyName = metadata.PropertyName;