Skip to content

Instantly share code, notes, and snippets.

🌞
building

Reuben Bond ReubenBond

🌞
building
Block or report user

Report or block ReubenBond

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ReubenBond
ReubenBond / Disable-AutomaticallyDetectSettings.ps1
Created Nov 23, 2011
Disable 'Automatically detect settings' in Internet Explorer's proxy settings dialog.
View Disable-AutomaticallyDetectSettings.ps1
# Disable 'Automatically detect proxy settings' in Internet Explorer.
function Disable-AutomaticallyDetectProxySettings
{
# Read connection settings from Internet Explorer.
$regKeyPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\"
$conSet = $(Get-ItemProperty $regKeyPath).DefaultConnectionSettings
# Index into DefaultConnectionSettings where the relevant flag resides.
$flagIndex = 8
View gist:8054104
trait FancyTrait {
def withContext(method: => () => Unit) = {
// define some context here, like:
val sender = this.sender
// run the method which can see the context
method()
}
}
@ReubenBond
ReubenBond / GrainObserverManager.cs
Last active Dec 5, 2017
Support grains & grain observers
View GrainObserverManager.cs
// --------------------------------------------------------------------------------------------------------------------
// <summary>
// Maintains a collection of <see cref="IGrainObserver" /> instances.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Grains.Utilities
{
using System;
using System.Collections;
@ReubenBond
ReubenBond / docdb_signature.cs
Last active Aug 29, 2015
Azure DocumentDB: Compute Signature
View docdb_signature.cs
public static string GetSignature(string masterKey, string resourceId, string resourceType, string xDate = null, string date = null)
{
if (string.IsNullOrEmpty(xDate) && string.IsNullOrEmpty(date))
{
throw new ArgumentException("Either xDate or date must be provided.");
}
const string AuthorizationFormat = "type={0}&ver={1}&sig={2}";
const string MasterToken = "master";
const string TokenVersion = "1.0";
View gist:c8406be708057c3bb14e
public async Task SendSms(string phoneNumber, string body)
{
// Sanitize the phone number.
phoneNumber = Regex.Replace(phoneNumber, "[^0-9]", string.Empty);
// Build the request.
var builder = new UriBuilder("https://rest.nexmo.com/sms/json");
var parameters = new Dictionary<string, string>
{
{ "api_key", this.apiKey },
View AzureJsonStore.cs
// --------------------------------------------------------------------------------------------------------------------
// <summary>
// The Azure JSON table storage provider.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Grains.Utilities
{
using System.Configuration;
using System.Threading.Tasks;
@ReubenBond
ReubenBond / WorkerRole.cs
Created Feb 26, 2015
Orleans: modifying internal provider config
View WorkerRole.cs
namespace Orleans.Azure.Silos
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
using Microsoft.WindowsAzure;
@ReubenBond
ReubenBond / ClusterManifestTemplate.xml
Last active Apr 16, 2019
Speedy Service Fabric Dev Cluster Upgrades
View ClusterManifestTemplate.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
The settings used within this ClusterManifest are expressly for use only
within a developer single-box environment. Any use of these settings outside
of that environment are highly likely to produce incorrect, and misperforming
@ReubenBond
ReubenBond / ChatRoomGrain.cs
Created May 14, 2015
ChatRoomGrain snippet
View ChatRoomGrain.cs
"Don't expect this to compile - it's just a snippet"
/// <summary>
/// The chat room grain.
/// </summary>
[StorageProvider(ProviderName = "chats")]
[Reentrant]
@ReubenBond
ReubenBond / TransactionExtensions.cs
Last active Apr 30, 2017
Taking part in Service Fabric transactions
View TransactionExtensions.cs
using System;
using System.Collections.Concurrent;
using System.Fabric.Replication;
using System.Reflection;
using System.Reflection.Emit;
using Microsoft.ServiceFabric.Data;
internal static class TransactionExtensions
{
You can’t perform that action at this time.