This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static class ExtensionMethods | |
{ | |
/// <summary> | |
/// The largest batch size allowed by Azure table storage. | |
/// </summary> | |
public const int MaxBatchSize = 100; | |
/// <summary> | |
/// Given a sequence of <see cref="ITableEntity"/> objects, returns them in batches of up to 100 entities |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// Windows Azure Table Storage does not support a StartsWith function | |
// on string properties. However, it does support the CompareTo function. | |
// This will allow us to simulate the StartsWith function by taking the | |
// substring that you want to match on and figuring out the exclusive | |
// upper bound by incrementing the last character. | |
// In this example, Buildings is a table that uses a postal code as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#.SYNOPSIS | |
# Writes text to the host, highlighting portions of the text that | |
# match one or more regular expression patterns in a different | |
# color. | |
# | |
#.DESCRIPTION | |
# There are two forms that this command can take: One which specifies | |
# a single regular expression pattern and a single color (which defaults | |
# to yellow if not specified), and another that takes a hashtable that | |
# consists of regular expressions for keys and colors for values. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
# MODULE | |
Description = "Common Dialogs Module" | |
ModuleVersion = '1.0' | |
GUID = '374EF8CD-AEC6-464C-92DA-290C662DA183' | |
# AUTHOR | |
Author = 'Josh Einstein' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyDbContext : DbContext | |
{ | |
/// <summary> | |
/// Initializes a new instance of the <see cref=“T:MyDbContext"/> class. | |
/// </summary> | |
public MyDbContext( ) | |
: base( "DefaultConnection" ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE VIEW ParameterDefaults_Date | |
AS | |
SELECT | |
CONVERT(date, GETUTCDATE()) AS [Today], | |
CONVERT(date, DATEADD(day, 1, GETUTCDATE())) AS [Tomorrow], | |
CONVERT(date, DATEADD(day, -1, GETUTCDATE())) AS [Yesterday], | |
CONVERT(date, DATEADD(day, 1-DATEPART(day, GETUTCDATE()), GETUTCDATE())) AS [ThisMonthStart], | |
CONVERT(date, DATEADD(day, -1, DATEADD(month, 1, DATEADD(day, 1-DATEPART(day, GETUTCDATE()), GETUTCDATE())))) AS [ThisMonthEnd], | |
CONVERT(date, DATEADD(month, 1, DATEADD(day, 1-DATEPART(day, GETUTCDATE()), GETUTCDATE()))) AS [NextMonthStart], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#.SYNOPSIS | |
# Exports objects to an Excel spreadsheet by writing them to a temporary | |
# CSV file and using Excel automation model to import it into a workbook. | |
# This allows formatting to be applied to columns which would not otherwise | |
# be possible in a plain CSV export. | |
function Export-Excel { | |
[CmdletBinding()] | |
param( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
// Query the OpsLog database for MACD records that have contact | |
// information in the record. A customer must also be associated | |
// with the record. | |
// No need to bother sorting here. That will happen in-memory in | |
// the next step. | |
var query = ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Mvc; | |
using Microsoft.Owin.Security; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Steps to create: | |
' 1. Turn on the "developer" tab in the ribbon. | |
' 2. Copy some cell to the clipboard. | |
' 3. Click into an empty cell. | |
' 4. Click "record macro" on the developer tab. | |
' 5. Name it "PasteVFC" and choose to store it in "Personal Macro Workbook" (important) | |
' 6. Click "paste special" and choose "values & formats" | |
' 7. In the same cell, click "paste special" and choose "comments" | |
' 8. Click "stop recording" on the developer tab | |
' 9. Click "Visual Basic" on the developer tab and the macro code *should* look like below |