Skip to content

Instantly share code, notes, and snippets.

View paynoattn's full-sized avatar

Chris Pawlukiewicz paynoattn

View GitHub Profile
@paynoattn
paynoattn / keybase.md
Created December 13, 2017 00:54
keybase.md

Keybase proof

I hereby claim:

  • I am paynoattn on github.
  • I am paynoattn (https://keybase.io/paynoattn) on keybase.
  • I have a public key ASBQ5h-mAfe7qL-oMdUAmy5t_3CAb5ADHwM0oDUM1REQIgo

To claim this, I am signing this object:

@paynoattn
paynoattn / scrollUpDownObservable.ts
Last active June 3, 2018 21:48
Creating an Window scroll up/down Observable
import { Subject } from 'rxJs/Rx';
const body = document.querySelector('body');
let beginningScrollPostion = body.scrollTop,
scrollObserver = new Subject<string>(),
windowEventListender = window.addEventListener('scroll', (scrollEvent) => {
if (body.scrollTop > beginningScrollPostion) {
scrollObserver.next('down');
} else {
scrollObserver.next('up');
@paynoattn
paynoattn / data.service.ts
Last active February 3, 2021 15:59
Simple Observable testing in Angular2
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { Data } from '../models';
@Injectable()
export class DataService {
dataUrl: string = 'data.json';
@paynoattn
paynoattn / login.component.ts
Last active September 23, 2021 10:35
Angular2 FormBuilder Specs
import {
FormGroup,
Validators,
FormBuilder
} from '@angular/forms';
import { Component } from '@angular/core';
import { User } from './../../models';
import { UserService } from './../../services';
@paynoattn
paynoattn / app.component.ts
Last active December 27, 2017 17:48
Angular2 Multipart forms with Component Interaction, Async Operations, and Validation
import { Component, OnInit } from '@angular/core';
import { User, UserProfile } from './models';
// import the user service. This isn't important for our demo, just think of it as an async data source.
import { UserService } from './services';
@Component({
selector: 'app',
template: `
<user-input [user]="user" (isValid)="userValid = $event">
@paynoattn
paynoattn / app.js
Created October 21, 2015 19:33
Simple AngularJS UI-Router List/Detail View
angular.module('routerApp', ['ui.router']);
.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.state('beatles', {
abstract: true,
url: '/beatles',
templateUrl: 'beattles.html'
})