Skip to content

Instantly share code, notes, and snippets.

Avatar

Randy Burden randyburden

View GitHub Profile
@randyburden
randyburden / InsertWithOracleArrayBinding.cs
Last active Aug 15, 2017
Insert list into a database table using Oracle array binding (a type of bulk insert)
View InsertWithOracleArrayBinding.cs
/// <summary>
/// Insert list into a database table using Oracle array binding (a type of bulk insert).
/// </summary>
/// <typeparam name="T">Type of data in list.</typeparam>
/// <param name="listOfData">List to insert.</param>
/// <param name="tableName">Table name.</param>
/// <returns>Rows affected.</returns>
public int Insert<T>(List<T> listOfData, string tableName) where T : class, new()
{
try
@randyburden
randyburden / VbaProject.OTM
Created Sep 30, 2016
Outlook VBA Scripts for Adding Categories to New Emails
View VbaProject.OTM
Public Sub ShowCategoriesDialog()
Dim Mail As Object
Set Mail = Application.ActiveInspector.CurrentItem
Mail.ShowCategoriesDialog
End Sub
Public Sub AddAwaitingFeedbackCategory()
Dim Mail As Object
Set Mail = Application.ActiveInspector.CurrentItem
Mail.Categories = "Awaiting Feedback"
@randyburden
randyburden / SocialSecurityNumberGenerator.cs
Created Sep 5, 2016
A C# helper class for generating random USA Social Security numbers. This was used in automated unit tests.
View SocialSecurityNumberGenerator.cs
using System;
namespace Helpers
{
/// <summary>
/// Social Security Number Generator.
/// </summary>
public static class SocialSecurityNumberGenerator
{
/// <summary>
@randyburden
randyburden / NameGenerator.cs
Created Sep 5, 2016
A C# helper class for generating random first names and random last names.
View NameGenerator.cs
using System;
namespace Helpers
{
/// <summary>
/// Name Generator.
/// </summary>
public static class NameGenerator
{
// List of the top 40 boy and girl baby names of 2016
@randyburden
randyburden / InjectAppNameIntoConnectionString.cs
Last active Jan 11, 2016
Inject Application Name Into ConnectionString
View InjectAppNameIntoConnectionString.cs
public string GetConnectionString( string connectionStringName, string applicationName )
{
var connectionString = ConfigurationManager.ConnectionStrings[ connectionStringName ];
var builder = new System.Data.SqlClient.SqlConnectionStringBuilder( connectionString );
// Inject application name into connection string
if ( String.IsNullOrWhiteSpace( builder.ApplicationName ) )
{
if ( String.IsNullOrWhiteSpace( applicationName ) == false )
@randyburden
randyburden / NanoWindowsServiceExample.cs
Created Oct 20, 2015
This is a working example of using the Nano micro web framework hosted as a Windows Service using the System.ServiceProcess .NET dependency to create a low dependency, low memory footprint website or web API.
View NanoWindowsServiceExample.cs
using System;
using System.Diagnostics;
using System.Threading;
using Nano.Web.Core;
using Nano.Web.Core.Host.HttpListener;
namespace NanoWindowsServiceExample
{
public class Program
{
@randyburden
randyburden / HttpClient.js
Created May 11, 2015
Simple JavaScript HTTP Client. Supports GET and POST.
View HttpClient.js
httpClient = {
get: function( url, data, callback ) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
var readyState = xhr.readyState;
if (readyState == 4) {
callback(xhr);
}
@randyburden
randyburden / DynamicallyLoadedJsonNetSerializer.cs
Last active Aug 29, 2015
Provides methods for serializing and deserializing JSON by using the Newtonsoft.Json aka JSON.NET library which is loaded dynamically via reflection.
View DynamicallyLoadedJsonNetSerializer.cs
using System;
using System.Reflection;
namespace ReflectionExample
{
/// <summary>
/// Provides methods for serializing and deserializing JSON by using the Newtonsoft.Json aka JSON.NET library
/// which is loaded dynamically via reflection.
/// </summary>
/// <remarks>
@randyburden
randyburden / AddConnectionStringAtRuntime.cs
Created Mar 23, 2015
Enables adding a ConnectionString at runtime
View AddConnectionStringAtRuntime.cs
// Enables adding a ConnectionString at runtime
typeof ( ConfigurationElementCollection )
.GetField( "bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic )
.SetValue( ConfigurationManager.ConnectionStrings, false );
View Node Videos Ive Watched.md

##Node Videos I've Watched: Some good, some meh..

###Node.js Tutorial with Ryan Dahl, creator of Node.js Video Published 02/22/2011 | Video Length: 1:06:33

https://www.youtube.com/watch?v=eqlZD21DME0

###Ryan Dahl - History of Node.js Video Published 10/05/2011 | Video Length: 1:03:40

You can’t perform that action at this time.