Skip to content

Instantly share code, notes, and snippets.

@jchannon
jchannon / info.md
Created July 12, 2016 20:00
Run dotnet build on all projects in your folder hierarchy

CMD+Shift+ in VSCode to run build task. If not configured VSCode will prompt you to choose a build system, choose CoreCLR, then paste the above json in.

This works on the Nancy code base where the folder structure is:

.
./src/Nancy/
./src/Nancy.Validation.FluentValidation/
./samples/Nancy.Demo.Hosting.Kestrel/
./tests/Nancy.Tests/
Configuration Result:
[Success] Name MyApp
[Success] Description MyApp FrontEnd
[Success] ServiceName MyApp
Topshelf v3.2.150.0, .NET Framework v4.0.30319.19448
Connected to Proxy
The MyApp service is now running, press Control+C to exit.
Running a http server on https://10.240.205.4:443
Topshelf.Hosts.ConsoleRunHost Critical: 0 : The service threw an unhandled exception, System.NullReferenceException: Object reference not set to an instance of an object.
at System.Net.HttpListener.EndGetContext(IAsyncResult asyncResult)
@jchannon
jchannon / helloworld.xcscheme
Last active May 11, 2016 18:08
Hello World App files within *.xcodeproj
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction>
<BuildActionEntries>
<BuildActionEntry
buildForRunning = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B4528147FFDCD6BD3D2805E8"
@jchannon
jchannon / httpStatusCodes.js
Created April 23, 2016 12:41 — forked from marlun78/httpStatusCodes.js
An HTTP Status Codes object
/**
* HTTP Status Codes
* Copyright (c) 2012, marlun78
* MIT License, https://gist.github.com/marlun78/bd0800cf5e8053ba9f83
*
* Taken from: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
* Visual Studio find regex: ^(\d{3}) ([^\r\n]+)\r\n
* Visual Studio replace regex: '$1': '$2', //
* Notes wrapped in parens moved manually
*/
static void Main()
{
MainAsync().Wait();
// or, if you want to avoid exceptions being wrapped into AggregateException:
// MainAsync().GetAwaiter().GetResult();
}
static async Task MainAsync()
{
...
@jchannon
jchannon / whitespace.sh
Last active December 6, 2015 10:11
List commits that ONLY contain whitespace changes. What about those that have valid changes and whitespace changes??
branch=dnx
for commit in $(git rev-list --no-merges $branch); do
if [ -z "$(git diff -b $commit^..$commit)" ]; then
echo "$commit only modifies whitespace."
fi
done
public interface IDbConnectionProvider
{
IDbConnection GetConnection();
}
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="ducknorris"
# Uncomment the following line to use case-sensitive completion.
@jchannon
jchannon / recipes.go
Last active November 2, 2015 17:41 — forked from philcleveland/routes.go
Currently how I define my routes for api's in Go. Up for discussion
type Recipe struct{}
func NewRecipe(*router router) *router {
router.HandleFunc("/recipe/{id}", GetById)
}
func GetById(writer w, *request r) *handler {
//do something
}
data := {Name : "Jon", Phone : "123456789"}