This file contains 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 interface ICache<out T> | |
{ | |
T Get(string key); | |
} | |
public class CacheObject<T> | |
{ | |
public T Value { get; set; } | |
public DateTime CachedDate { get; set; } |
This file contains 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
(require 'find-file-in-project) | |
(defvar css-regexp "\\.\\(-?[_a-zA-Z]+[_a-zA-Z0-9-]*\\)\\s-*{") | |
(defun parse-css-class-names () | |
(make-local-variable 'ffip-patterns) | |
(setq ffip-patterns '("*.css")) | |
(let (matches) | |
(dolist (f (mapcar 'cdr (ffip-project-files))) |
This file contains 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
;; Dynamic form population based on Christophe Grand's suggestions found here: | |
;; http://bit.ly/72NkNS | |
(ns dynamic-form | |
(:refer-clojure :exclude [empty complement]) | |
(:use net.cgrand.enlive-html) | |
(:import [java.io File])) | |
(defn populate-select [options] | |
(fn [node] |
This file contains 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
// ## Theme and UserControl Inversion of Control | |
// | |
// BaseClasses or Interfaces which UserControls derive from are bound to an implemenation for a given theme. | |
// This gives complete flexibility over which programs are using which controls, and | |
// a container to tie it all together rather than just ConfigKeys | |
// and 'if..then' statements sprinkled throughout the codebase. Pages query ThemeService (see *Resolve* method) | |
// for which UserControl to render, and based on the current program a path to the proper UserControl is returned. | |
// | |
// In this case ThemeService is our IOC container, and the bindings are defined below in C#. | |
// Currently there are two themes ("Default" or "Facelift"), and are put in a static hash-table. When *Resolve* is |
This file contains 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
<?php | |
/* | |
This code is meant to function with two tables like: | |
config_key | |
| id | key_name | default_value | | |
|----+-------------+---------------| | |
| 1 | ProgramName | s:0:""; | | |
| 2 | IsEnabled | b:0; | |
This file contains 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
/// <summary> | |
/// Rollback Attribute wraps test execution into a transaction and cancels the transaction once the test is finished. | |
/// You can use this attribute on single test methods or test classes/suites | |
/// </summary> | |
public class RollbackAttribute : Attribute, ITestAction | |
{ | |
private TransactionScope _transaction; | |
public void BeforeTest(TestDetails testDetails) | |
{ |
This file contains 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
(assembly-load "ClojureClrEx") | |
(ns clync.core | |
(:use [clojure.clr.pinvoke :only [dllimports]])) | |
(dllimports | |
"Kernel32.dll" | |
(GetStdHandle IntPtr [Int32]) | |
(SetConsoleTextAttribute Boolean [IntPtr UInt32])) |
This file contains 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
<#@ Assembly Name="EnvDTE" #> | |
<#@ Assembly Name="System.Configuration.dll" #> | |
<#@ import namespace="System.Configuration" #> | |
<#@ import namespace="System.Text.RegularExpressions" #> | |
<#@ IntelliSenseLanguage processor="tangibleT4Editor" language="C#" #> | |
<#+ | |
string GetConnectionString() | |
{ | |
var host = (IServiceProvider)Host; |
This file contains 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
<#@ template debug="true" hostSpecific="true" #> | |
<#@ output extension=".cs" #> | |
<#@ Assembly Name="System.Core.dll" #> | |
<#@ Assembly Name="System.Xml.dll" #> | |
<#@ Assembly Name="System.Configuration.dll" #> | |
<#@ Assembly Name="System.Security.dll" #> | |
<#@ Assembly Name="System.Xml.Linq.dll" #> | |
<#@ Assembly Name="System.Data.dll" #> | |
<#@ Assembly Name="System.Configuration.dll" #> | |
<#@ import namespace="System" #> |
This file contains 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
/// <summary> | |
/// Represents an ObjectDataSource that binds to its hosting page or user control | |
/// </summary> | |
[ToolboxData("<{0}:PageDataSource runat=server></{0}:PageDataSource>")] | |
public class PageDataSource : ObjectDataSource | |
{ | |
public PageDataSource() | |
: this(String.Empty, String.Empty) | |
{ | |
} |