Skip to content

Instantly share code, notes, and snippets.

View bryan-c-oconnell's full-sized avatar

Bryan O'Connell bryan-c-oconnell

View GitHub Profile
using System;
using System.Runtime.Caching;
namespace BOC.Samples.Caching
{
/// <summary>A simple wrapper for the .NET memory cache.</summary>
/// <remarks>Samples to create this class were taken from the following posts:
/// - http://www.allinsight.de/caching-objects-in-net-with-memorycache/
/// - http://www.codeproject.com/Articles/756423/How-to-Cache-Objects-Simply-using-System-Runtime-C
/// </remarks>
@bryan-c-oconnell
bryan-c-oconnell / WebApiConfig.cs
Created September 28, 2015 15:34
bryanoconnell.blogspot.com - Easily expose metadata information from Web API
// Written by Bryan O'Connell, June 2015
// http://bryanoconnell.blogspot.com/2015/08/easily-expose-metadata-info-from-webapi.html
// Purpose: Example of how to configure routes to expose metadata information
// about specific objects in your API.
using System;
using System.Web.Http;
using System.Web.Http.OData.Builder;
using System.Web.Http.OData.Extensions;
@bryan-c-oconnell
bryan-c-oconnell / api-tester.ts
Last active October 4, 2016 21:12
bryanoconnell.blogspot.com - Exploring TypeScript (an API testing module)
module BOC.ApiTester {
export class ApiTests {
private results: ResultsLog;
private timeTracker: Timer;
private outputElement: HTMLElement;
static baseUrl: string = "http://jsonplaceholder.typicode.com";
constructor(elementIdToDisplayResults: string) {
this.results = new ResultsLog();
@bryan-c-oconnell
bryan-c-oconnell / ExcelExtract.ps1
Last active November 10, 2015 14:18
bryanoconnell.blogspot.com - Extract worksheets from Excel into separate files with PowerShell
# |Info|
# Written by Bryan O'Connell, September 2012
# Purpose: Extract all of the worksheets from an Excel file into separate files.
# Sample command: PowerShell.exe xls_extract.ps1 -filepath "C:\Spreadsheet.xls" -output_type "csv"
# Params:
# -filepath: The Excel file you want to extract worksheets from.
# -output_type: The filetype to save the Worksheets as (can be csv, txt, xls, html).
# |Info|
[CmdletBinding()]
@bryan-c-oconnell
bryan-c-oconnell / DeleteOldFiles.ps1
Last active August 29, 2015 14:09
bryanoconnell.blogspot.com - Clean up old files using PowerShell
# |Info|
# Written by Bryan O'Connell, February 2013
# Purpose: Delete files from a folder haven't been modified for the
# specified number of days.
#
# Sample: DeleteOldFiles.ps1 -folder "C:\test" -days_old 7 [-only_this_type ".xls"]
#
# Params:
# -folder: The place to search for old files.
#
@bryan-c-oconnell
bryan-c-oconnell / ZipStuff.ps1
Created November 13, 2014 00:00
bryanoconnell.blogspot.com - Create zip files using PowerShell
# |Info|
# Written by Bryan O'Connell, August 2013
# Purpose: Creates a .zip file of a file or folder.
#
# Sample: zipstuff.ps1 -target "C:\Projects\wsubi" -zip_to "C:\Users\Bryan\Desktop\wsubi" [-compression fast] [-timestamp] [-confirm]
#
# Params:
# -target: The file or folder you would like to zip.
#
# -zip_to: The location where the zip file will be created. If an old version
@bryan-c-oconnell
bryan-c-oconnell / RestApiTest.ps1
Last active February 8, 2021 07:53
bryanoconnell.blogspot.com - Test your RESTful API using PowerShell
# |Info|
# Written by Bryan O'Connell, November 2014
# Purpose: Sample of a functional test script for a RESTful API.
#
# Thanks to contributors on the 'jsonplaceholder' project for making a publicly
# accesible and generic REST API (which is used in the examples below).
# - http://jsonplaceholder.typicode.com
# - https://github.com/typicode/jsonplaceholder
#
# |Info|