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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup Condition="'$(ToolsDir)' == ''"> | |
<ToolsDir>$(SolutionDir)\Tools\</ToolsDir> | |
</PropertyGroup> | |
<PropertyGroup> | |
<StyleCopTreatErrorsAsWarnings>false</StyleCopTreatErrorsAsWarnings> | |
<StyleCopAnalysisTarget Condition=" '$(StyleCopAnalysisTarget)' == '' ">$(ToolsDir)StyleCop\Microsoft.SourceAnalysis.targets</StyleCopAnalysisTarget> |
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 static void Dump(ZmqSocket socket, Encoding encoding) | |
{ | |
if (socket == null) { | |
throw new ArgumentNullException("socket"); | |
} | |
Console.WriteLine(new String('-', 38)); | |
ZmqMessage message = socket.ReceiveMessage(); | |
foreach (var frame in message) | |
{ |
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.IO; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
using System.Data.Entity; | |
using System.Data.Entity.Core.EntityClient; | |
using System.Data.Entity.Infrastructure; | |
using System.Diagnostics; |
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
let emptyIfZero f x = | |
match x with | |
| 0 -> [] | |
| _ -> f x | |
let elementsBetween0And20 = emptyIfZero (fun x -> [ string x ]) | |
let elementsBetween21And99 x = string (x - (x % 10)) :: elementsBetween0And20 (x % 10) | |
let ifGreaterThan y f g x = if x > y then f x else g x | |
let elementsFor2DigitNumber = ifGreaterThan 20 elementsBetween21And99 elementsBetween0And20 | |
let elementsBetween100And999 x = string (x / 100) :: "hundred" :: emptyIfZero (fun x -> "and" :: elementsFor2DigitNumber x) (x % 100) |
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
db.currentOp().inprog.forEach( | |
function(op) { | |
if(op.secs_running > 5) printjson(op); | |
} | |
) |
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.Globalization; | |
using Irony.Parsing; | |
namespace Grammar | |
{ | |
[Language("LuceneGrammar", "1.0", "Lucene Grammar")] | |
public class LuceneGrammar : Irony.Parsing.Grammar | |
{ | |
public LuceneGrammar() | |
: base(true) // true means case sensitive |
$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
I'm using this Vagrantfile
to run Kafka on a Windows 8.1 laptop for development purposes.
It runs the ultra-lightweight boot2docker Linux, then uses Vagrant's Docker provisioning support to spin up ZooKeeper and Kafka.
The fun bits to work out were:
- You need to forward the ports on both Vagrant (lines 13 & 14) and Docker (the
-p
flag), so you can access the instance from Windows usinglocalhost:9092
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
Split-Path -parent $dte.Solution.FileName | cd | |
New-Item -ItemType Directory -Force -Path ".\licenses" | |
@( Get-Project -All | ? { $_.ProjectName } | % { Get-Package -ProjectName $_.ProjectName } ) | Sort -Unique Id | % { $pkg = $_ ; Try { (New-Object System.Net.WebClient).DownloadFile($pkg.LicenseUrl, (Join-Path (pwd) 'licenses\') + $pkg.Id + ".html") } Catch [system.exception] { Write-Host "Could not download license for $($pkg.Id)" } } |
OlderNewer