Skip to content

Instantly share code, notes, and snippets.

Mark Rendle markrendle

Block or report user

Report or block markrendle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
markrendle / eg.cs
Last active Aug 29, 2015
Destructuring arbitrary types with attributes
View eg.cs
// Modifiers on primary constructor params would be nice :-)
struct Point(private readonly double x, private readonly double y)
public double X { get; } = x;
public double Y { get; } = y;
markrendle / More.txt
Created Feb 27, 2014
Ultra-private field: force access of variable via property even within class
View More.txt
OK, so technically within the class you can still access the variable by calling getMyProperty or setMyProperty instead of via the property, but you still encapsulate the functionality with the getting and setting.
markrendle /
Created May 6, 2014
AngularJS & TypeScript talk abstract

AngularJS is Google's answer to client-side JavaScript MVC application development.

TypeScript is Microsoft's answer to working large, complex JavaScript code-bases. It adds static typing and supports features from next-generation JavaScript, such as classes and modules.

Put them together and you get something a bit like WPF-style MVVM, but better. This talk will introduce AngularJS and TypeScript, and show how to combine them effectively to build real browser-based applications.

markrendle / command.ts
Created Jun 12, 2014
ICommand-ish pattern for AngularJS
View command.ts
module Zudio.System {
var trueFunc = ()=> true;
export class Command {
public cssClass: string;
public canExecute: () => boolean;
public show: () => boolean;
constructor(cssClass: string, public text: string, public execute: Function, canExecute?: () => boolean, show?: () => boolean) {
this.cssClass = "icon-" + cssClass;
this.canExecute = canExecute || trueFunc; = show || trueFunc;
View sgMarkdown.ts
module SgDirectives {
declare function marked(source: string): string;
function syncHeights(source: HTMLElement, target: HTMLElement) {
var syncHeight = () => = source.offsetHeight + "px";
source.addEventListener("mouseup", syncHeight);
function link(scope: ng.IScope, jelem: ng.IAugmentedJQuery) {
markrendle / trashTheForm.js
Created Jul 17, 2014
Trash ASPX server-side form for SPA pages
View trashTheForm.js
// Requires jQuery
$(function() {
var $theForm = $("#theForm"), contents = $theForm.contents();
markrendle / CheckQueueRoutes.cs
Created Aug 6, 2014
Route-validating Assertion
View CheckQueueRoutes.cs
public class CheckQueueRoutes : RouteMarchBase<QueueController>
public void MatchesDeleteMessagePath()
ctrl => ctrl.Delete("testaccount", "testqueue", "testid", "testpop", null));
markrendle / Startup.cs
Created Sep 11, 2014
This cannot be right
View Startup.cs
.SetupOptions<MvcOptions>(options =>
var currentJson = options.OutputFormatters.FirstOrDefault(f => f.Instance is JsonOutputFormatter);
if (currentJson != null) options.OutputFormatters.Remove(currentJson);
options.OutputFormatters.Add(new JsonOutputFormatter(new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() }, false));
markrendle / Gulpfile.js
Last active Aug 29, 2015
Gulpfile December
View Gulpfile.js
* Created by Mark on 15/12/2014.
/* global require */
var gulp = require('gulp'),
typescript = require('gulp-tsc'),
html2js = require('gulp-ng-html2js'),
concat = require('gulp-concat');
gulp.task("typescript", function() {
markrendle / TaskFfs.cs
Created Mar 31, 2015
async/await convenience method
View TaskFfs.cs
namespace System.Threading.Tasks
public static class TaskFfs
public static ConfiguredTaskAwaitable FFS(this Task task)
return task.ConfigureAwait(false);
You can’t perform that action at this time.