Skip to content

Instantly share code, notes, and snippets.

View rhargreaves's full-sized avatar

Robert Hargreaves rhargreaves

View GitHub Profile
@beccasaurus
beccasaurus / README.markdown
Created April 19, 2011 17:50
Without this, returning a 400 gives you just "Bad Request" ... with this, you can return a custom response

If you don't have the XML snippet below in your Web.config and your .NET app tries to return a 400 with custom data, you get this:

HTTP/1.1 400 Bad Request
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET

Date: Tue, 19 Apr 2011 17:47:46 GMT

@ssg
ssg / MBUnit to NUnit.md
Last active March 13, 2017 08:19
MBUnit <-> NUnit migration cheat sheet.

This is a cheat sheet I prepared when testing migrations between MBUnit and NUnit. It only covers the areas we used so it's far from complete. It should give a good head start though.

MBUnit NUnit
[FixtureSetUp] [OneTimeSetUp]
[Row] [TestCase]
[Factory] [TestCaseSource] for test cases, [ValueSource] for individual parameters
[Column] [Values]
[SequentialJoin] [Sequential]
[CombinatorialJoin] [Combinatorial]
#!/usr/bin/env ruby
require 'fastly'
service_id = 'deadbeefdeadbeef'
fastly = Fastly.new(:api_key => 'deadbeefdeadbeefdeadbeef')
service = fastly.get_service(service_id)
latest_version = service.version
@olmobrutall
olmobrutall / gist:31d2abafe0b21b017d56
Last active December 21, 2020 09:42
Proposal for C# Non-Nullable Reference Types

Proposal for C# Non-Nullable Reference Types

This document tries to be an ordered compilation of the ideas exposed in https://roslyn.codeplex.com/discussions/541334

Also interesting is the original proposal I based my solution in http://twistedoakstudios.com/blog/Post330_non-nullable-types-vs-c-fixing-the-billion-dollar-mistake

And the uservoice suggestion to get Microsoft feel the urgency: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2320188-add-non-nullable-reference-types-in-c?page=3&per_page=20

Introduction

#--------------------
#
# Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#