Skip to content

Instantly share code, notes, and snippets.

View devdays's full-sized avatar

Bruce D Kyle devdays

View GitHub Profile
@devdays
devdays / css-absoluteboxes.html
Created February 16, 2015 21:06
Demonstrating default behavior of absolute boxes
<div style="width: 300px; border: 1px solid blue">
<div style="position: absolute;
background-color: powderblue;">hello</div>
</div>
<div style="position: relative;">&nbsp;</div>
<div style="width: 300px; border: 1px solid red">
<div style="position: absolute;
background-color: lightgoldenrodyellow">hello there</div>
</div>
<div style="position: relative;">&nbsp;</div>
@devdays
devdays / css-blocklevelboxes.html
Last active August 29, 2015 14:15
Block Level Boxes
<div style="width: 300px; background-color: azure; border: 1px solid blue">
<div style="padding: 20px; background-color: lightgoldenrodyellow">This box has a padding of 20 pixels. Now is the time for all good men to come to the aid of their country. The quick fox jumped over the road.</div>
<div></div>
<div style="padding: 20px; width: 100%; background-color: lightcoral">This box has a padding of 20 pixels and a width of 100%. Now is the time for all good men to come to the aid of their country. The quick fox jumped over the road.</div>
</div>
@devdays
devdays / Redis-OutputCache.xml
Created February 5, 2015 19:03
Redis Output cache pseudo code
<caching>
<outputCache defaultProvider="MyRedisOutputCache">
<providers>
<add name="MyRedisOutputCache"
host = "127.0.0.1" [String]
port = "" [number]
accessKey = "" [String]
ssl = "false" [true|false]
databaseId = "0" [number]
applicationName = "" [String]
@devdays
devdays / RedisSessionState.xml
Created February 5, 2015 19:02
Redis SessionState provider in XML
<sessionState mode="Custom" customProvider="MySessionStateStore">
<providers>
<add name="MySessionStateStore"
host = "127.0.0.1" [String]
port = "" [number]
accessKey = "" [String]
ssl = "false" [true|false]
throwOnError = "true" [true|false]
retryTimeoutInMilliseconds = "0" [number]
databaseId = "0" [number]
@devdays
devdays / redis-setTimeout.cs
Created February 5, 2015 19:00
Redis Set cache timeout
cache.StringSet("key1", "value1", TimeSpan.FromMinutes(90));
@devdays
devdays / redis-setAndGetValue.cs
Created February 5, 2015 18:59
Redis Cache from .NET
IDatabase cache = Connection.GetDatabase();
// Perform cache operations using the cache object...
// Simple put of integral data types into the cache
cache.StringSet("key1", "value");
cache.StringSet("key2", 25);
// Simple get of data types from the cache
string key1 = cache.StringGet("key1");
int key2 = (int)cache.StringGet("key2");
@devdays
devdays / redis-connectionmultiplexer.cs
Created February 5, 2015 18:58
Redis connection multiplexer
ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("contoso5.redis.cache.windows.net,ssl=true,password=...");
@devdays
devdays / using-redis.cs
Created February 5, 2015 18:57
redis using statement
using StackExchange.Redis;
@devdays
devdays / registeringTheLoggerAndCounter.cs
Last active August 29, 2015 14:13
Registering the instances in the container
private static void InitializeContainer(Container container)
{
// Register ConsoleLogger as a singleton
container.RegisterSingle<ILogger, ConsoleLogger>();
// container.Register<ILogger, ConsoleLogger>(Lifestyle.Singleton);
container.Register<ICounter, Counter>();
}
@devdays
devdays / ConsoleLogger.cs
Created January 19, 2015 20:11
Sample Logger for SimpleInjectorDemo
using Interfaces;
using System;
namespace Common
{
public class ConsoleLogger : ILogger
{
public void LogMessage(string message)
{
Console.WriteLine(message);