Skip to content

Instantly share code, notes, and snippets.

View johnpapa's full-sized avatar
💭
🐺Winter is coming

John Papa johnpapa

💭
🐺Winter is coming
View GitHub Profile
@johnpapa
johnpapa / create new file
Last active January 4, 2021 15:09
Getting Started Super Fast - Angular 2 CDN'd
npm init –y
npm i angular2 systemjs --save --save-exact
npm i typescript tsd live-server --save-dev
@johnpapa
johnpapa / keybindings.json
Created October 13, 2015 01:19
Getting back the standard CMD+= zoom in VS Code
{
"key": "cmd+=",
"command": "workbench.action.zoomIn"
},
{
"key": "cmd+-",
"command": "workbench.action.zoomOut"
}
@johnpapa
johnpapa / package.json
Last active December 29, 2015 15:11
running browser sync to launch an angular2 app with history fallback
{
"name": "angular2-getting-started",
"version": "1.0.0",
"description": "",
"scripts": {
"tsc": "tsc -p src -w"
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-alpha.44",
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u @ \w$\[\033[32m\]\$(parse_git_branch)\[\033[00m\] \n$ "
@johnpapa
johnpapa / foo.html
Last active January 13, 2016 05:48
Material Design Lite Snackbar / Toast
<div class="paper-snackbar">
Your message was sent
</div>
@johnpapa
johnpapa / character.service.ts
Created January 17, 2016 00:02
subscription examples
import { Injectable } from 'angular2/core';
import { Http, Response, RequestMethod } from 'angular2/http';
import { Observable } from 'rxjs/Rx';
import { CONFIG } from '../shared/config';
import { MessageService } from '../shared/message.service';
let baseUrls = CONFIG.baseUrls;
export interface Character {
id: number;
@johnpapa
johnpapa / systemjs.config.js
Last active May 1, 2016 22:40
A2 new world config
(function (global) {
// TODO: cli should auto-generate this on the fly
var packages = [
// 'app',
'@angular/common',
'@angular/compiler',
'@angular/core',
'@angular/http',
'@angular/platform-browser',
@johnpapa
johnpapa / foo.html
Last active August 20, 2016 23:01
Angular 2 data binding progression
<div>
<h2>Binding</h2>
<h4>Interpolation</h4>
<pre>Hello { {firstName }}</pre>
<div>Hello {{firstName}}</div>
<hr>
<h4>Property Binding Without Two-Way</h4>
<pre>&lt;input [value]="city"></pre>
@johnpapa
johnpapa / dashboard.component.ts
Created August 31, 2016 04:20
Angular 2 Component Animation
import { ComponentOnInit } from '@angular/core';
import { HostBinding, animate, trigger, state, style, transition } from '@angular/core';
@Component({
templateUrl: 'dashboard.component.html',
animations: [
trigger('routeAnimation', [
state('*',
style({
opacity: 1,
Name: John Papa
Company: Microsoft
Title: Partner GM - Developer Relations
Twitter: @john_papa
Web site: https://www.johnpapa.net