Skip to content

Instantly share code, notes, and snippets.

View bradygaster-zz's full-sized avatar

brady gaster bradygaster-zz

View GitHub Profile
public class Program
{
}
swagger: '2.0'
info:
version: v1
title: Contact List
description: A Contact list API based on Swagger and built using Node.js
host: localhost
schemes:
- http
- https
basePath: /
@bradygaster-zz
bradygaster-zz / GenericJsonApiClient.cs
Last active December 17, 2015 22:29
A generic class that can call REST services and parse their JSON output, or process the deserialized version of the JSON output.
namespace GenericRestTools
{
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
@bradygaster-zz
bradygaster-zz / Customer.cs
Created November 19, 2012 07:22
Connecting Windows Azure Web Sites to On Premises Databases
namespace WebSitesWithOnPremIntegration.Core
{
public class Customer
{
public long Id { get; set; }
public string Name { get; set; }
public string City { get; set; }
public string Country { get; set; }
}
}
@bradygaster-zz
bradygaster-zz / Configuration.cs
Created October 28, 2012 19:25
Code associated with a location API used to demonstrate EF Spatial and Windows Azure Web Sites
internal sealed class Configuration : DbMigrationsConfiguration<SpatialDemo.Models.SpatialDemoContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
protected override void Seed(SpatialDemo.Models.SpatialDemoContext context)
{
context.Locations.AddOrUpdate((x) => x.Name,
static void Main(string[] args)
{
Debug.Listeners.Add(new ConsoleTraceListener());
Debug.AutoFlush = true;
string url = "http://*:8081/";
var server = new Server(url);
server.Configuration.DisconnectTimeout = TimeSpan.Zero;
server.AuthenticationSchemes = AuthenticationSchemes.Ntlm;
@bradygaster-zz
bradygaster-zz / chatHub-1.cs
Created August 22, 2012 15:06
SignalR 0.5.3 Sample Code
[HubName("chat")]
public class ChatHub : Hub
{
public void SendMessage(dynamic message)
{
Clients.receiveMessage(message);
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<appSettings>
<add key="LogStorageConnectionString"
value="DefaultEndpointsProtocol=https;AccountName=[YOUR-ACCOUNT];AccountKey=[YOUR-KEY]" />
</appSettings>
<system.webServer>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="message"></div>
<script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script>
<script type="text/javascript">
$(function () {
namespace NandyFxDemo.NancyStuff
{
public class Bootstrapper : Nancy.DefaultNancyBootstrapper
{
protected override void ConfigureConventions(Nancy.Conventions.NancyConventions nancyConventions)
{
base.ConfigureConventions(nancyConventions);
nancyConventions.StaticContentsConventions.Add(
Nancy.Conventions.StaticContentConventionBuilder.AddFile("/Default.html", "Default.html")