Skip to content

Instantly share code, notes, and snippets.

View csharpfritz's full-sized avatar
💭
Writing code LIVE on twitch.tv/csharpfritz

Jeffrey T. Fritz csharpfritz

💭
Writing code LIVE on twitch.tv/csharpfritz
View GitHub Profile
@csharpfritz
csharpfritz / JeffAuthorizeAttribute
Created March 24, 2011 00:04
A half-baked authorize attribute example
public class JeffAuthorizeAttribute : ActionFilterAttribute
{
#region Fields
private Permissions _Required;
#endregion
public JeffAuthorizeAttribute(Permissions requiredPerm)
@csharpfritz
csharpfritz / HtmlTableMissingCells.html
Created May 31, 2011 11:43
Plain table that cuts off cells on page 2 and later when printed in IE and Chrome
<html><head>
</head><body>
<table width='100%' cellspacing='0' > <tr><td align='left'>Date</td><td align='left'>Order No.</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287426</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>288175</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287787</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287802</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287806</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287894</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287889</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287439</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287885</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287845</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287884</td></tr> <tr><td align='left'>5/24/2011</td><td align='left'>287900</td></tr> <tr><td align='left'>5/24/2011<
@csharpfritz
csharpfritz / gist:1134105
Created August 9, 2011 13:55
MassTransit bus config
IUnityContainer _Unity = // blah blah blah... configured Unity elsewhere
Bus.Initialize(sbc =>
{
sbc.UseMsmq();
sbc.VerifyMsmqConfiguration();
sbc.UseMulticastSubscriptionClient();
sbc.ReceiveFrom(queueName);
sbc.Subscribe(
subs =>
@csharpfritz
csharpfritz / shallowCopy.cs
Created September 27, 2011 15:37
Example of a shallow copy of a CLR generic List<T>
namespace Test
{
public static class ExtMethods
{
public static List<T> Clone<T>(this List<T> thisList)
{
// For-loop allows for later management of the copy.. if we wanted to perform additional operations later
@csharpfritz
csharpfritz / default.aspx
Last active December 20, 2015 12:38
Telerik AJAX RadMenu that executes a JavaScript function
<telerik:RadMenu runat="server" ID="tkMenu">
<Items>
<telerik:RadMenuItem Text="Telerik"></telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
@csharpfritz
csharpfritz / Repository.cs
Created February 18, 2014 21:39
Generic Telerik Backend Services Repository object
public class Repository<T> where T : DataItem
{
private EverliveApp app;
public Repository()
{
this.app = new EverliveApp(ConfigurationManager.AppSettings["apiKey"]);
app.WorkWith().Authentication().Login(ConfigurationManager.AppSettings["apiUser"], ConfigurationManager.AppSettings["apiPass"]);
public class ContactsController : ApiController
{
[HttpGet]
public IEnumerable<Contact> GetAll()
{
return new Contact[] {
new Contact { Id = 1, EmailAddress = "[email protected]", Name = "Barney Poland"},
@csharpfritz
csharpfritz / nuget-nuspec.xsd
Last active April 6, 2018 08:46
Test schema for NuGet's packages.config file
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="nuspec"
elementFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="3.3"
>
<xs:element name="package">
<xs:annotation>
<xs:documentation source="http://docs.nuget.org/Create/Nuspec-Reference" xml:lang="en">The root element of a package definition</xs:documentation>
</xs:annotation>
@csharpfritz
csharpfritz / keybase.md
Created February 15, 2017 22:02
Keybase identity proof

Keybase proof

I hereby claim:

  • I am csharpfritz on github.
  • I am jeffreytfritz (https://keybase.io/jeffreytfritz) on keybase.
  • I have a public key whose fingerprint is 8378 B9B1 E508 7EFB BAB1 34D8 8A96 CB2B 080C CD83

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am csharpfritz on github.
  • I am jeffreytfritz (https://keybase.io/jeffreytfritz) on keybase.
  • I have a public key ASAysH3VC9LXGB4H8s40RyF9bED4ZZF3V9f4Ki27FaIgFwo

To claim this, I am signing this object: