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
using System; | |
namespace MyExtensions | |
{ | |
public static class DateTimeExtensions | |
{ | |
public const long EpochTicks = 621355968000000000; | |
public const long TicksPeriod = 10000000; | |
public const long TicksPeriodMs = 10000; |
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
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit; | |
namespace Syntheticks.Tests.Designs | |
{ | |
public class TimeSeries_AdvancedDesign |
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: WebActivator.PreApplicationStartMethod(typeof(MyApp.App_Start.NinjectWebCommon), "Start")] | |
[assembly: WebActivator.ApplicationShutdownMethodAttribute(typeof(MyApp.App_Start.NinjectWebCommon), "Stop")] | |
// please add a reference to NInject.MVC3 | |
namespace MyApp.App_Start | |
{ | |
using System; | |
using System.Web; | |
using System.Web.Mvc; |
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
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Table; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit; | |
namespace Syntheticks.Tests.Designs | |
{ | |
public class DataPoint : TableEntity |
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
-------------------------------------------------------------------------------- | |
-- Multi HINCRBY via a LUA script | |
-- Increments a list of fields in a hash stored at key. | |
-- KEYS : key of the hash | |
-- ARGS : list of field/increment | |
-- Note : Because a script is executed in an atomic way, you should always use this script to increment fields values. | |
-- ex via cli : redis-cli --eval hmincr.lua myhash , 1 10 2 20 | |
-------------------------------------------------------------------------------- | |
-- gets multiple fields from a redis hash as a dictionary |
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
// npm install native-hdr-histogram prob.js redis | |
var prob = require('prob.js'); | |
var redis = require("redis"); | |
var Histogram = require('native-hdr-histogram'); | |
//generate fake response times | |
var random = prob.lognormal(0, 1.0); // μ = 0, σ = 1.0 | |
var histogram = new Histogram(1, 120 * 1000); | |
var client = redis.createClient({ host: 'localhost', port: 6379 }); |
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
using System; | |
using System.Linq; | |
namespace MyFunnyProject | |
{ | |
internal static class EnumHelper | |
{ | |
public static class EnumCache<TEnum> | |
{ | |
public readonly static TEnum[] Values = null; |
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
using System; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace RegexOptims | |
{ | |
public static class RegexComparer | |
{ | |
private const string REGEX_PATTERN = @"^[\w\d]+$"; |
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
using StructureMap; | |
using System; | |
using System.ServiceModel; | |
namespace MyWcfService.Classes | |
{ | |
public class CustomServiceHost : ServiceHost | |
{ | |
public CustomServiceHost(IContainer container, Type serviceType, params Uri[] baseAddresses) | |
: base(serviceType, baseAddresses) |
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
for %%f in (*.jpg) do jpegtran -copy none -optimize %%f %%~nf.jpg |
NewerOlder