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.Linq.Expressions; | |
namespace Foundation.Specifications | |
{ | |
/// <summary> | |
/// Defines an abstract class from which to create conditional specifications. | |
/// </summary> | |
/// <typeparam name="T">The type of entity used in the specification.</typeparam> | |
/// <seealso href="http://ubik.com.au/article/named/implementing_the_specification_pattern_with_linq" /> |
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
// Written by Michael Carter ([email protected]) | |
// Copyright (c) 2012. All rights reserved. | |
// | |
// Redistribution and use of this code WITHOUT MODIFICATIONS are permitted provided that | |
// the following conditions are met: | |
// 1. Redistributions must retain the above copyright notice, this list of conditions | |
// and the following disclaimer. | |
// 2. Neither the name of an author nor the names of the contributors may be used | |
// to endorse or promote products derived from this software without specific | |
// prior written permission. |
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
public static class CSV | |
{ | |
public static string ToCSV(this DataTable table) | |
{ | |
var columnHeaders = (from DataColumn x in table.Columns | |
select x.ColumnName).ToArray(); | |
StringBuilder builder = new StringBuilder(String.Join(",", columnHeaders)); | |
builder.Append("\n"); | |
foreach (DataRow row in table.Rows) |
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
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
VERSION="20200421.1" | |
_usage() { | |
cat << __EOF | |
$0 usage: |
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
public class RequireRouteValuesAttribute : ActionMethodSelectorAttribute { | |
public string[] ValueNames { get; private set; } | |
public RequireRouteValuesAttribute(params string[] valueNames) { | |
ValueNames = valueNames; | |
} | |
/// <summary> | |
/// Check for all strings | |
/// </summary> |
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
<?php | |
// This map would show Germany: | |
$south = deg2rad(47.2); | |
$north = deg2rad(55.2); | |
$west = deg2rad(5.8); | |
$east = deg2rad(15.2); | |
// This also controls the aspect ratio of the projection | |
$width = 1000; |
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.Text.RegularExpressions; | |
using System.Reflection; | |
namespace RegexLibraryBuilder | |
{ | |
/// <summary> | |
/// Summary description for Class1. | |
/// </summary> | |
class RegexBuilderMain | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="chart"></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
<ul class="list-group"> | |
<li class="list-group-item-cust list-group-item"><span class="list-group-addon glyphicon glyphicon-calendar"></span> | |
8th March 2014</li> | |
<li class="list-group-item-cust list-group-item"><span class="list-group-addon glyphicon glyphicon-time"></span> | |
10:00</li> | |
<li class="list-group-item-cust list-group-item"><span class="list-group-addon glyphicon glyphicon-flag"></span> | |
Location</li> | |
</ul> |
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
[HttpPost] | |
public HttpResponseMessage CreateCustomer(string name, string billingInfo) | |
{ | |
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo); | |
Result<CustomerName> customerNameResult = CustomerName.Create(name); | |
return Result.Combine(billingInfoResult, customerNameResult) | |
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value)) | |
.OnSuccess(() => new Customer(customerNameResult.Value)) | |
.OnSuccess( |
OlderNewer