Skip to content

Instantly share code, notes, and snippets.

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Rego
file_extensions:
- rego
- Rego
scope: source.rego
contexts:
main:
@rickj33
rickj33 / CustomerController.cs
Created September 28, 2018 18:23 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[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(
@rickj33
rickj33 / .block
Last active October 5, 2016 21:00
TopoJsonMergeIssue
license: gpl-3.0
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
// "steps" is an array of functions... work to be done
;(function ( $, window, undefined ) {
/*
Handle data layer of the tables.
*/
var CustomDataView = function(options) {
$.extend(this.defaults, options);
}
CustomDataView.prototype = {
data: {}
@rickj33
rickj33 / Fingerprint.cs
Created March 17, 2014 15:17
IIS Asset cache fingerprinting.
//source-reference http://madskristensen.net/post/cache-busting-in-aspnet
using System;
using System.IO;
using System.Web;
using System.Web.Caching;
using System.Web.Hosting;
public class Fingerprint
{
public static string Tag(string rootRelativePath)
/**************************************************************************
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <[email protected]>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The Fuck You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*