Skip to content

Instantly share code, notes, and snippets.

Tieson Trowbridge tiesont

Block or report user

Report or block tiesont

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
View ExceptionXElement.cs
using System;
using System.Collections;
using System.Linq;
using System.Xml.Linq;
/// <summary>Represent an Exception as XML data.</summary>
public class ExceptionXElement : XElement
{
/// <summary>Create an instance of ExceptionXElement.</summary>
/// <param name="exception">The Exception to serialize.</param>
View RandomDataSet.cs
class RandomDataSet
{
private int seed, compCount;
private List<int> idataset = new List<int>();
/// <summary>
/// Default constructor.
/// </summary>
public RandomDataSet()
: this( new List<int>(), 0, System.DateTime.Now.Millisecond )
@tiesont
tiesont / HashUtility.cs
Last active Dec 22, 2015
C# Hashing utility, as used in Monkey.CMS.
View HashUtility.cs
using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Utilities
{
/// <summary>
/// Simple utility class for generating hashes for string values.
/// </summary>
@tiesont
tiesont / CustomRoleProvider.cs
Created Sep 3, 2013
Template implementation of a custom ASP.NET RoleProvider, using C#
View CustomRoleProvider.cs
using System;
using System.Collections.Specialized;
using System.Configuration.Provider;
using System.Linq;
using System.Web.Configuration;
using System.Web.Security;
namespace Custom.Providers
{
public class CustomRoleProvider : RoleProvider
@tiesont
tiesont / CustomMembershipProvider.cs
Last active Dec 22, 2015
Template implementation of a custom ASP.NET MembershipProvider, using C#.
View CustomMembershipProvider.cs
using System;
using System.Collections.Specialized;
using System.Configuration.Provider;
using System.Web.Configuration;
using System.Web.Security;
namespace Custom.Providers
{
public class CustomMembershipProvider : MembershipProvider
{
View OpenSslAes.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace dotnet_aes
{
public class OpenSslAes
{
@tiesont
tiesont / gmailsender.cs
Last active Jan 2, 2016
Helper class used to access a Gmail account remotely for the purpose of sending an email message
View gmailsender.cs
/// <summary>
/// GmailSender: Class used to access a Gmail account remotely for the purpose of sending an email message
/// </summary>
public class GmailSender
{
/// <summary>
/// Static method. Accepts required elements for sending a email through the Google Mail system.
/// </summary>
/// <param name="to">The target (recipient) of the email message.</param>
/// <param name="subject">Subject line value for the email.</param>
@tiesont
tiesont / SecurityProvider.cs
Created May 10, 2014
Partial class for plugging into FluentSecurity
View SecurityProvider.cs
public partial class SecurityProvider
{
public static bool ActionIsAllowedForUser(string controllerName, string actionName)
{
var configuration = SecurityConfiguration.Get<MvcConfiguration>();
var policyContainer = configuration.Runtime.PolicyContainers.GetContainerFor(controllerName, actionName);
if (policyContainer != null)
{
var results = policyContainer.EnforcePolicies(configuration.CreateContext());
return results.All(x => x.ViolationOccured == false);
View config.json
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 46.7%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
@tiesont
tiesont / OpenSslAes.vb
Created Jan 21, 2015
VisualBasic.NET implementation of Scott Lowe's OpenSslAes class.
View OpenSslAes.vb
Imports System.Collections.Generic
Imports System.IO
Imports System.Security.Cryptography
Imports System.Text
Namespace Security
''' <summary>
''' OpenSSL AES CBC 256 in .NET for interop with Ruby
''' </summary>
You can’t perform that action at this time.