Skip to content

Instantly share code, notes, and snippets.

View Rowversion.cs
using System;
using System.Diagnostics;
[DebuggerDisplay("{ToString(),nq}")]
public readonly struct Rowversion : IComparable, IEquatable<Rowversion>, IComparable<Rowversion>
{
public static Rowversion Zero => default;
private readonly ulong value;
View HttpControllerActivator.cs
//This is for your web api controllers.
public class HttpControllerActivator : IHttpControllerActivator
{
private readonly IContainer _container;
public HttpControllerActivator(IContainer container)
{
_container = container;
}
View cron_helper.sh
#!/bin/bash
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
Arguments:
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021
Learning Haskell
View gist:8739525
@darrelmiller
darrelmiller / gist:8548166
Created Jan 21, 2014
How to tell Web API 2.1 to allow errors to propagate up the MessageHandler pipeline so all exceptions can be converted to HttpResponseMessages in one place.
View gist:8548166
class Program
{
static void Main(string[] args)
{
var server = WebApp.Start("http://localhost:1002/", (app) =>
{
var config = new HttpConfiguration();
config.MapHttpAttributeRoutes();
config.Services.Replace(typeof(IExceptionHandler), new RethrowExceptionHandler());
@ceejbot
ceejbot / stashwoes.md
Last active Mar 14, 2019
A summary of things I miss about Github when I use Stash.
View stashwoes.md

What I miss about github

See this Cloudup stream for visual references.

The short answer is that I miss everything. There is no comparing the two projects. Stash's feature set is a shadow of Github's.

What a project looks like on Github:

What a project looks like on Github

@stevenkuhn
stevenkuhn / gist:5062660
Last active Feb 15, 2022
This PowerShell script generates release notes for Octopus Deploy that contain the GitHub commits and JIRA issues from the current build to the latest production release. It will also create the Octopus release based on the TeamCity build number.
View gist:5062660
#
# Assumptions
#
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git
# tag set for that commit in GitHub that is "v1.0.0.73".
#
# 2. You have TeamCity label each successful build in GitHub with the format
# "v{build number}. Sidenote: it appears that TeamCity only labels the
# default branch, but not feature branches.
#
@jmarnold
jmarnold / IntegrationTestExample.cs
Created Feb 2, 2013
Sample integration testing
View IntegrationTestExample.cs
[TestFixture]
public class IntegrationTestExample
{
// You'll want the FubuMVC.Katana package for this
private EmbeddedFubuMvcServer theServer;
[SetUp]
public void SetUp()
{
theServer = new MyApplication().RunEmbedded();
@mwjackson
mwjackson / .gitconfig
Created Oct 19, 2011
p4merge with git (msysgit)
View .gitconfig
[diff]
tool = p4merge
[difftool "p4merge"]
path = C:/Program Files/Perforce/p4merge.exe
[merge]
summary = true
tool = p4merge
[mergetool "p4merge"]
path = C:/Program Files/Perforce/p4merge.exe
keepBackup = false