Skip to content

Instantly share code, notes, and snippets.

View scottcate's full-sized avatar

Scott Cate scottcate

View GitHub Profile
@scottcate
scottcate / Bookmarklet for CDA Web Trends
Last active March 28, 2022 01:24
Bookmarklet Template for adding Web Trends tracking
@scottcate
scottcate / AddUTMs.js
Last active September 5, 2017 09:33
Purpose of this gist, is to store the contents of a bookmarklet. This let's me quickly add two UTM query string parameters to the current page in a browser.
javascript:(function(){
var a = "scottca";
var l = window.location;
var s = l.search;
var utms = (s?s+"&":"?")+"utm_source="+a+"&utm_medium=twitter"+l.hash;
l.assign(utms);
})();
namespace definition
{
public class AuthorizationGroup
{
public string[] Groups { get; set; }
}
}
@scottcate
scottcate / resources-en.xml
Created January 26, 2013 18:28
Windows 8: Score Keeper English resw file, if someone wants to help localize the application to their own language, this is the starter kit.
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
@scottcate
scottcate / DescriptionFor.cs
Last active July 5, 2022 20:21
Outputs the DataAttribute [Display(Description="long desc")] Has the option to override the tag (defaults to span) and option to add a cssClassName Usage inline in comments
public static class HtmlHelpers
{
/// Code started from SO:
/// http://stackoverflow.com/questions/6578495/how-do-i-display-the-displayattribute-description-attribute-value
/// <summary>
/// Usage:
/// @Html.DisplayFor(m => m.PropertyName)
///
/// supply cssclass name, and override span with div tag
/// @Html.DisplayFor(m => m.PropertyName, "desc", "div")
@scottcate
scottcate / DateTimeExtensions.cs
Created August 28, 2012 20:08
Extension methods for Noda Time - to
using System;
using NodaTime;
using NodaTime.TimeZones;
namespace Whatever
{
public static class DateTimeExtensions
{
public static DateTime AdjustTo(this DateTime date, string timeZoneId)