This is content converted from Markdown!
Here's a JSON sample:
{
"foo": "bar"
}
<html> | |
<head> | |
<style> | |
h1 { | |
font-family: Calibri; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Extensions; |
public virtual CheckInRequestResult CanCheckIn(EventHydrationContext ehc, IClock clock, | |
ReservationFolioState fs) { | |
if (State == ReservationState.CheckedIn) { | |
return CheckInRequestResult.AlreadyCheckedIn; | |
} | |
if (State != ReservationState.Open) { | |
return CheckInRequestResult.NoOpenReservation; | |
} |
// Bad version | |
protected DollarCents Calculate() { | |
var x = Events.OfType<CardSaleAttached>().Select(e => e.Sale) | |
.Aggregate(DollarCents.Zero, (a, b) => a + b.SecuredMoney()); | |
var y = Events.OfType<FolioPaymentReceived>() | |
.Aggregate(DollarCents.Zero, (a, b) => a + b.Amount); | |
return x + y; | |
} | |
// Good version |
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory lf) { | |
if (env.IsDevelopment()) { | |
app.UseDeveloperExceptionPage(); | |
} else { | |
app.UseExceptionHandler("/error"); | |
app.UseReverseProxyHttpsEnforcer(); | |
} | |
app.UseAuthentication(); | |
app.UseStaticFiles(); |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
namespace interval.Support { | |
public class ReverseProxyHttpsEnforcer { | |
private const string ForwardedProtoHeader = "X-Forwarded-Proto"; | |
private readonly RequestDelegate _next; | |
public ReverseProxyHttpsEnforcer(RequestDelegate next) { |
#!/usr/bin/env ruby | |
require 'httparty' | |
require 'optparse' | |
require 'ostruct' | |
# That was simple | |
class PingdomAPI | |
include HTTParty | |
base_uri 'https://api.pingdom.com/' |
indexer: chef-expander -n1 | |
solr: chef-solr | |
server: chef-server -N -e production -p 4001 | |
serverweb: chef-server-webui -p 4040 -e production |
log_level :info | |
log_location STDOUT | |
ssl_verify_mode :verify_none | |
chef_server_url "http://localhost:4001" | |
signing_ca_path "/var/chef/ca" | |
couchdb_database 'chef' | |
cookbook_path [ "/Users/dra/git/chef/cookbooks" ] | |