Skip to content

Instantly share code, notes, and snippets.

View scottmcarthur's full-sized avatar

Scott McArthur scottmcarthur

  • Edinburgh, United Kingdom
View GitHub Profile
@scottmcarthur
scottmcarthur / ServiceStackExample.cs
Last active August 29, 2015 14:06
Example ServiceStack App
using System;
using System.Linq;
using ServiceStack;
using System.Data;
using System.Collections.Generic;
using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite;
namespace MyApp.Tests
{
@scottmcarthur
scottmcarthur / ServiceStackIsolatedAppHostTest.cs
Created September 25, 2014 15:34
ServiceStack AppHost Running in it's own AppDomain for Tests
using System;
using ServiceStack;
using System.Runtime.Remoting;
using NUnit.Framework;
namespace MyApp.Tests
{
public class AppHost : AppSelfHostBase
{
public AppHost(): base("My ServiceStack Service", typeof(AppHost).Assembly)
@scottmcarthur
scottmcarthur / EventHandlerSample.cs
Created June 10, 2014 09:29
Shows using an EventHandler in a dependency within a ServiceStack service
using System;
using ServiceStack;
using Funq;
using System.Timers;
namespace RedisTest
{
class MainClass
{
public static void Main()
@scottmcarthur
scottmcarthur / program.cs
Created May 29, 2014 11:24
ServiceStack HttpError.NotFound bug when using DELETE method
using System;
using Funq;
using ServiceStack;
namespace V4
{
class MainClass
{
public static void Main()
{
@scottmcarthur
scottmcarthur / program.cs
Created May 28, 2014 18:31
ServiceStack v4 Funq container test, reuse scope request (http://localhost:9000/Test?Hello=World)
using System;
using Funq;
using ServiceStack;
namespace V4
{
class MainClass
{
public static void Main()
{
@scottmcarthur
scottmcarthur / Program.cs
Created April 29, 2014 09:13
Sending complex data to ServiceStack from HTML form synchronously. (ServiceStack v4)
using System;
using ServiceStack;
using ServiceStack.Web;
using ServiceStack.Text;
namespace v4
{
class MainClass
{
public static void Main()
@scottmcarthur
scottmcarthur / AppDelegate.cs
Created April 4, 2014 19:22
UINavigationController Null in UIScrollView ScrollAnimationEnded event after ResignFirstResponder
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;
namespace PopTestApp
{
[Register("AppDelegate")]
public class AppDelegate : UIApplicationDelegate
{
UIWindow window;
@scottmcarthur
scottmcarthur / program.cs
Created March 7, 2014 09:30
Example of Custom Serialization in ServiceStack v4.
using System;
using ServiceStack;
using ServiceStack.Web;
namespace CustomSerializerTest
{
class MainClass
{
public static void Main()
{
@scottmcarthur
scottmcarthur / App.ts
Created February 17, 2014 14:33
Source code for http://stackoverflow.com/questions/21796849/angularjs-typescript-routing (Not my personal TypeScript format)
/// <reference path="angular.d.ts" />
/// <reference path="angular-route.d.ts" />
'use strict';
// Create and register modules
var modules = ['app.controllers','app.directives', 'app.filters', 'app.services'];
modules.forEach((module) => angular.module(module, []));
// *** Push ngRoute or $routeProvider won't work ***
@scottmcarthur
scottmcarthur / app.ts
Last active August 15, 2019 12:39
How to use AngularJS ng.resource.IResource with TypeScript.
/// <reference path="angular.d.ts" />
/// <reference path="angular-resource.d.ts" />
interface IEmployee extends ng.resource.IResource<IEmployee>
{
id: number;
firstName : string;
lastName : string;
}
interface IEmployeeResource extends ng.resource.IResourceClass<IEmployee>