Skip to content

Instantly share code, notes, and snippets.

Jaben Cargman Jaben

Block or report user

Report or block Jaben

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
View designer.html
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@Jaben
Jaben / Hubs.tt
Last active Jan 4, 2016 — forked from htuomola/Hubs.tt
Updated to support generics (1 type parameter currently) and inherited types. Setup for SignalR v1.1.3 -- but just change reference to support SignalR v2.0.
View Hubs.tt
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".d.ts" #>
<# /* Update this line to match your version of SignalR */ #>
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.1.1.3\lib\net40\Microsoft.AspNet.SignalR.Core.dll" #>
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #>
<#@ assembly name="$(TargetPath)" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Web" #>
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
@Jaben
Jaben / CamelCaseResponseJsonNetSerializer.cs
Last active Dec 22, 2015
camelCase outbound responses for SignalR v1.x.
View CamelCaseResponseJsonNetSerializer.cs
using System;
using System.IO;
using System.Linq;
using Microsoft.AspNet.SignalR.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
@Jaben
Jaben / durandal\plugins\viewconvention.js
Last active Dec 20, 2015
Provides a convention of loading views in modules by looking for the moduleId or moduleIdView case-insensitive. Useful for TypeScript AMD style definition with exports.
View durandal\plugins\viewconvention.js
define(['exports', 'durandal/system'], function(exports, system) {
var afterDash = function(str) {
var dashIndex = str.lastIndexOf("/", str.length - 1);
return str.substr(dashIndex + 1, str.length - dashIndex);
};
var findPropCaseInsensitive = function(obj, propName) {
var propLower = propName.toLowerCase();
for (var prop in obj) {
@Jaben
Jaben / system.js
Last active Dec 20, 2015
Patch to Extend Durandal's v2.0 handling of module exports (AMD) -- specifically make it work with TypeScript AMD exports.
View system.js
/**
* Resolves the default object instance for a module.
* If the module is a function, that function is called with `new` and it's result is returned.
* If the module is an export object (AMD), a function named '[moduleId]' or '[moduleId]View' created with 'new' and returned.
* If the module is an export object (AMD), a instance named '[moduleId]' or '[moduleId]View' is returned.
* If the module is an object, the instance is returned.
* @method resolveObject
* @param {object} module The module to use to get/create the default object for.
* @return {object} The default object for the module.
*/
@Jaben
Jaben / router.js
Last active Dec 20, 2015
Patch to 'Fix' Durandal v1.x Loading in Router.js for TypeScript AMD requireJS.
View router.js
getActivatableInstance: function (routeInfo, params, module) {
var afterDash = function (str) {
var dashIndex = str.lastIndexOf("/", str.length - 1);
return str.substr(dashIndex+1, str.length - dashIndex);
};
var findPropCaseInsensitive = function(obj, propName) {
propLower = propName.toLowerCase();
for (var prop in obj) {
You can’t perform that action at this time.