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 / program.cs
Created February 9, 2014 13:09
Transparent Encoded Complex Ids in Request/Response DTO in ServiceStack v4. (With support for string[])
using System;
using ServiceStack;
using System.Text;
using ServiceStack.Web;
using System.Collections.Generic;
namespace ComplexIdTest
{
class MainClass
{
@scottmcarthur
scottmcarthur / program.cs
Created February 13, 2014 15:17
How to use a RequestBinder in ServiceStack (v4) to convert a complex JSON object into a request.
using System;
using System.Linq;
using ServiceStack.Text;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.Web;
using System.Net;
namespace JsonTest
@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>
@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 / 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 / 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 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 / 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 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 / 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()