Skip to content

Instantly share code, notes, and snippets.

@tstpierre
tstpierre / App.xaml
Created April 22, 2016 05:05
Prism.Forms App.xaml
<?xml version="1.0" encoding="utf-8" ?>
<prism:PrismApplication xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:prism="clr-namespace:Prism.Unity;assembly=Prism.Unity.Forms"
x:Class="MyApp.App">
<prism:PrismApplication.Resources>
<ResourceDictionary>
<Color x:Key="backgroundColor">#33302E</Color>
</ResourceDictionary>
@tstpierre
tstpierre / IUserService.ts
Created March 29, 2016 17:00
Some Angular 1 strong typing from http service to controller usage
module app.services {
export interface IUserModel {
id: number;
firstName: string;
lastName: string;
}
export interface IFindUserByIdRequestModel {
id: number;
@tstpierre
tstpierre / MyAppController.ts
Created March 29, 2016 16:19
Barebones Angular 1 strong typed controller view model with TS
module app {
// Declare items explicitly the ng Controller will
// expose to the template html
export interface IMyViewModel {
firstName: string;
lastName: string;
getFullname(): string;
@tstpierre
tstpierre / gulpfile.js
Created March 29, 2016 16:09
Example of merging legacy JavaScript and new TypeScript in the same build process
//
// Written in-gist, so there could be typos.
// The point of this is to show merging two gulp streams with event-stream.
//
var gulp = require('gulp');
var ts = require('gulp-typescript');
var eventStream = require('event-stream');
var concat = require('gulp-concat');
<!-- Redirect all traffic to SSL -->
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false" />
<conditions>
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
@tstpierre
tstpierre / _.md
Created March 21, 2014 00:13
Stacked bars baseline at one series
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/mathjs/0.18.1/math.min.js" type="text/javascript"></script>
</head>
<body>