Skip to content

Instantly share code, notes, and snippets.

View johnlindquist's full-sized avatar
💭
Eating a taco 🌮

John Lindquist johnlindquist

💭
Eating a taco 🌮
View GitHub Profile
import {Component, EventEmitter} from "angular2/core";
import {Http} from 'angular2/http';
import {Subject} from "rxjs/Rx";
@Component({
selector: 'app',
template: `
<div>{{(selectedPerson | async)?.name}}</div>
<hr/>
<div *ngFor="#person of data | async">
@johnlindquist
johnlindquist / dummy-data.json
Created January 16, 2016 21:38
Some Grouped Dummy Data
[
{
"letter": "B",
"contacts": [
{
"id": 8,
"name": {
"first": "Royal",
"last": "Bergnaum"
},
; ***** PKL.ini file for PortableKeyboardLayout (by Farkas M�t�), written by �ystein Bech "DreymaR" Gadmar *****
; ***** Extend mapped for the AngleZ-ANSI left hand mod ( _ZXCVB --> _XCVBZ ) *****
; ***** Extend mapped for standard non-Wide (or Wide registry-mapped) layouts *****
; =======================================================================================
; NOTE: Remove the ';' in front of 'layout = ' on only one line below - or make your own!
; =======================================================================================
[pkl]
; The layout ini file is "layouts/[key value]/layout.ini"
; I'm using Colemak if any keys look out of place...
#MaxHotkeysPerInterval 20000
#InstallKeybdHook
#SingleInstance force
#NoEnv
SendMode Input
#Persistent
SetCapsLockState, AlwaysOff
; Colemak layout for AutoHotkey (MS Windows)
; 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain.
; See http://www.autohotkey.com/ for more information
; For this to work you have to make sure that the US (QWERTY) layout is installed,
; that is set as the default layout, and that it is set as the current layout.
; Otherwise some of the key mappings will be wrong.
;
; This is mainly useful for those who don't have privileges to install a new layout
; This doesn't support the international features of the Colemak layout.
#MaxHotkeysPerInterval 20000
; I'm using Colemak if any keys look out of place...
#MaxHotkeysPerInterval 20000
#InstallKeybdHook
#NoEnv
;=
Tab & y:: Send `=
Tab & `;:: Send `>
;{}
Tab & n::Send +[
const go = state=> Object.assign(state, {isRunning:true});
const inc = state=> Object.assign(state, {isRunning:true, tick: state.tick + 1});
const zero = state=> Object.assign(state, {isRunning:false, tick:0});
const stop = state=> Object.assign(state, {isRunning:false});
const timer = Observable.interval(1000);
const {start, pause, reset} = this;
this.timerView = start
.switchMap(() => Observable.merge(
import {REQUEST_POSTS, RECEIVE_POSTS, INVALIDATE_REDDIT, SELECT_REDDIT, INIT} from '../reducers/reddit';
import {Observable} from 'rxjs/Observable';
import {Reddit} from '../services/reddit';
//surrounding func for deps
export const redditPreMiddleware = function (reddit:Reddit) {
//return an Obs carrying the type/payload to pass to reducers
return (o$:Observable<{type:string, payload:any}>)=> {
return o$
@johnlindquist
johnlindquist / README.md
Created March 15, 2016 15:54
Angular2 + Typescript Demo @ngrx/store 1.3.3 Beta.9

Angular2 Starter Plunker - Typescript - Beta9

@johnlindquist
johnlindquist / config.js
Created March 15, 2016 20:43
angular2 http demo
System.config({
transpiler: 'typescript',
typescriptOptions: {
emitDecoratorMetadata: true
},
map: {
app: './src'
},
packages: {
app: {