Skip to content

Instantly share code, notes, and snippets.

oexenhave / MachineConfigurationManager
Created October 31, 2016 20:56
A ConfigurationManager wrapper that allows the developer to store credentials and a like settings in a machine specific config file that takes precedence when loading over web.config
View MachineConfigurationManager
public class MachineConfigurationManager
private const string ConfigFileCacheKey = "ConfigFileCacheKey";
private static readonly ILog Logger = LogManager.GetLogger(typeof(MachineConfigurationManager));
public static void Init()
var _file = GetConfigFile();
if (!_file.Exists)
oexenhave / CsvReader.cs
Last active August 29, 2015 14:16
View CsvReader.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace TimeLog.IO
public class CsvReader
public bool HasHeaders { get; private set; }
oexenhave / TLPAPIScaffolding2
Created January 2, 2014 10:30
TimeLog Project API Scaffolding method example
View TLPAPIScaffolding2
using log4net;
using log4net.Config;
using System;
using System.Linq;
using System.Diagnostics;
using System.IO;
namespace APIScaffolding
public class App
oexenhave / TLPAPIScaffolding
Created January 2, 2014 09:50
TimeLog Project API Scaffolding class
View TLPAPIScaffolding
using System;
using System.Configuration;
using System.Linq;
namespace APIScaffolding
public class TimelogServices
private TimeLogSecurityService.SecurityServiceClient _securityService;
public TimeLogSecurityService.SecurityServiceClient SecurityService
oexenhave / TLPFetchTasks
Created May 20, 2013 14:55
Controller method for getting tasks from the TimeLog Project API and returning it as JSON
View TLPFetchTasks
/// <summary>
/// Gets a list of tasks allocated to the currently authenticated user
/// </summary>
/// <returns>A JsonResult with tasks</returns>
public ActionResult Get()
// Prepare the envelope with a faulty state
JsonEnvelope<IEnumerable<Task>> result = new JsonEnvelope<IEnumerable<Task>> { Success = false, Data = new List<Task>(), Message = "No tasks" };
// Query the TimeLog Project web service for tasks allocated to the employee
oexenhave / TLPTaskFetch
Created May 20, 2013 14:47
Angular code for fetching tasks
View TLPTaskFetch
function DashboardCtrl($scope) {
// ¤¤¤ Property definitions ¤¤¤
$scope.tasks = [];
$scope.query = '';
// ¤¤¤ Method definitions ¤¤¤
$scope.getTasks = function () {
// Fetch the list of tasks from the web service
$.getJSON(root + 'Task/Get', {}, function (data) {
$scope.$apply(function (scope) {
oexenhave / TLPTaskView
Created May 20, 2013 14:32
AngularJS task view
View TLPTaskView
<div ng-controller="DashboardCtrl">
<p>Search: <input type="text" id="query" ng-change="filterChange()" ng-model="query" /></p>
<div class="contentband" id="registrationBand">
<label class="overflow gridCol-04 posLeft" title="{{selectedTask}}">{{selectedTask}}</label>:
<input type="text" ng-model="registrationHours" id="registrationHours" class="gridCol-01" /> hours -
<input type="text" ng-model="registrationText" id="registrationText" class="gridCol-02" /></div>
<table id="tasks">