Skip to content

Instantly share code, notes, and snippets.

View randyburden's full-sized avatar

Randy Burden randyburden

View GitHub Profile
@randyburden
randyburden / TestHelper.CodeGenerator.cs
Created February 4, 2014 22:12
A little test helper code generator class that will script out some C# for a given type. It is meant to help aid in generating boilerplate unit test code.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace TestHelper
{
[TestFixture]
@randyburden
randyburden / gist:192944935ba2360e3e0b
Created October 31, 2014 04:47
Paper Weight Chart
Paper Weight Chart
------------------
16 lb bond - 60 g/m2
17 lb bond - 64 g/m2
18 lb bond - 64 g/m2 or 67.7 g/m2 or 69 g/m2
19 lb bond - 71 g/m2 or 74 g/m2 or 75 g/m2
20 lb bond - 74 g/m2 or 75 g/m2 or 75.2 g/m2 or 80 g/m2
24 lb bond - 90 g/m2
@randyburden
randyburden / PdfSharpExtensions.cs
Created November 2, 2014 21:30
PdfSharp extensions for adding a 2D DataMatrix barcode to a PdfPage using the IEC16022Sharp library to generate the 2D barcode image.
namespace PDFMerger.Utilities
{
/// <summary>
/// Provides extension methods for PdfSharp objects.
/// </summary>
public static class PdfSharpExtensions
{
/// <summary>
/// Adds a 2D DataMatrix barcode to the PdfPage.
/// </summary>
@randyburden
randyburden / C# Web Servers.md
Created February 2, 2015 00:20
Links to various implementations of C# Web Servers
@randyburden
randyburden / Node Videos Ive Watched.md
Created February 2, 2015 02:04
Node Videos I've Watched

##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

@randyburden
randyburden / AddConnectionStringAtRuntime.cs
Created March 23, 2015 17:06
Enables adding a ConnectionString at runtime
// Enables adding a ConnectionString at runtime
typeof ( ConfigurationElementCollection )
.GetField( "bReadOnly", BindingFlags.Instance | BindingFlags.NonPublic )
.SetValue( ConfigurationManager.ConnectionStrings, false );
@randyburden
randyburden / DynamicallyLoadedJsonNetSerializer.cs
Last active August 29, 2015 14:19
Provides methods for serializing and deserializing JSON by using the Newtonsoft.Json aka JSON.NET library which is loaded dynamically via reflection.
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 / gist:1915136
Created February 26, 2012 08:23
Enabling Custom Key-Press Logic for an IsReadOnly WPF RichTextBox
In your XAML:
-------------
<RichTextBox
Name="MyRichTextBox"
PreviewKeyDown="MyRichTextBox_PreviewKeyDown" />
In your C# Code-behind:
-----------------------
@randyburden
randyburden / FluentTableCells.js
Created May 7, 2012 19:01
Fluent Table Cells - An easily extendible fluent interface for programmatically creating table cells in JavaScript.
/*!
* Fluent Table Cells - An easily extendible fluent interface for programmatically creating table cells in JavaScript.
* Author: Randy Burden
* http://www.randyburden.com
* Open Source Url: https://gist.github.com/2629702
*
* Example usage:
var row = '<tr>';
@randyburden
randyburden / HtmlWithJQueryTemplate.html
Created November 15, 2012 22:45
HTML webpage template with jQuery and jQuery UI included
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- Stylesheets -->
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/smoothness/jquery-ui.css" >
<style type="text/css">
body { font-family: Arial, Sans-Serif; font-size: 12pt; }