This file contains hidden or 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
<h1>Comments</h1> | |
<div id="comments" data-bind="foreach: comments"> | |
<h2><a data-bind="attr: { href: '/posts/#' + id }, text: title"></a></h2> | |
<div data-bind="text: body"></div> | |
</div> |
This file contains hidden or 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
<h1>Comments</h1> | |
<div id="comments"> | |
{{#each comments}} | |
<h2><a href="/posts/#{{id}}">{{title}}</a></h2> | |
<div>{{body}}</div> | |
{{/each}} | |
</div> |
This file contains hidden or 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
var result = elasticClient.Search<ErrorDocument>(s => s | |
.FacetDateHistogram(fd => fd | |
.OnField(p => p.Time) | |
.Interval(DateInterval.Day) | |
.Global() | |
.FacetFilter(ff => ff | |
.Range(rf => rf | |
.From(DateTime.UtcNow.AddDays(-14)) | |
.To(DateTime.UtcNow) | |
) |
This file contains hidden or 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.Threading; | |
using System.Web.Mvc; | |
namespace MvcApplication1.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
public ActionResult Index() | |
{ |
This file contains hidden or 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.Web; | |
using System.Web.Mvc; | |
using StatsdClient; | |
using Stopwatch = System.Diagnostics.Stopwatch; | |
namespace MvcApplication1.Controllers | |
{ | |
public class StatsdActionFilter : ActionFilterAttribute | |
{ | |
private const string StopwatchKey = "stopwatch"; |
This file contains hidden or 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
var metricsConfig = new MetricsConfig | |
{ | |
StatsdServerName = "localhost", | |
Prefix = "myMvcApp" | |
}; | |
Metrics.Configure(metricsConfig); |
This file contains hidden or 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
GlobalFilters.Filters.Add(new StatsdActionFilter()); |
This file contains hidden or 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
$subject = $args[0] | |
$message = $args[1] | |
$from = $args[2] | |
$to = $args[3] | |
$smtpserver = "<smtp server>" | |
$smtpport = 465 | |
$username = "<smtp username>" | |
$password = "<smtp port>" | |
$credentials = New-Object System.Net.NetworkCredential($username, $password) | |
$smtp = New-Object Net.Mail.SmtpClient($smtpserver, $smtpport) |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "precise32" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
config.vm.provision :shell, :path => "bootstrap.sh" | |
config.vm.network :forwarded_port, guest: 9200, host: 9200 | |
end |
This file contains hidden or 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
#!/bin/sh | |
# | |
# This is a script to run syntax check (via `sh -n $filename`) but it | |
# supports recursive checking and --quiet | |
QUIET=0 | |
while [ "$1" != "" ]; do | |
PARAM=`echo $1 | awk -F= '{print $1}'` | |
VALUE=`echo $1 | awk -F= '{print $2}'` | |
case $PARAM in |