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
-------------------------------------------------------------------------------- | |
-- 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
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 |
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
[].forEach.call(document.querySelectorAll('a'), function(a) { | |
var href = a.getAttribute('href'); | |
if(href && href.indexOf('http:')>-1) | |
console.log(href); | |
}); |
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
Write-Host "Deleting bin, obj, packages,TestResults folders ..." -nonewline | |
Get-ChildItem -inc bin,obj,TestResults,packages -rec | Remove-Item -rec -force | |
Write-Host "Done" -ForegroundColor Yellow |
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 MyNamespace | |
{ | |
public static class PerfStatsExtensions | |
{ | |
public static double? Avg(this double[] values) | |
{ | |
if (values == null) return 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 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
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 |
NewerOlder