Skip to content

Instantly share code, notes, and snippets.

View peterbsmyth's full-sized avatar

Peter B Smith peterbsmyth

View GitHub Profile
@peterbsmyth
peterbsmyth / user.reducer.ts
Last active January 5, 2018 16:47
ngRx practice
import * as userActions from '../actions/user';
import * as skillActions from '../actions/skill';
export interface State {
user: {
isPro: boolean;
skills: any[];
id;
cards: any[];
};

Thank You For Arguing / Rhetoric of The Wire Companion

Argument Tool: THE ADVANTAGEOUS: Base your argument on what's good for the audience, not for you.

Cicero's Outline

Introduction

The ethos part, which wins you the "interest and the good will of the audience," as Cicero puts it. (He calls this section the exordium.)

@peterbsmyth
peterbsmyth / post-data.json
Last active December 13, 2017 18:49 — forked from djowinz/post-data.json
Account Creation: Pro
{
"legal_entity.address.city": "CA",
"legal_entity.address.line1": "56 Bridgeport Street",
"legal_entity.address.line2": "",
"legal_entity.address.postal_code": "92629",
"legal_entity.address.state": "California",
"legal_entity.dob.day": 26,
"legal_entity.dob.month": 8,
"legal_entity.dob.year": 1992,
"legal_entity.ssn_last_4": 0000,
@peterbsmyth
peterbsmyth / github.effects.ts
Last active November 6, 2017 18:14
Showing an architectural question
import { Injectable } from '@angular/core';
import { Effect, Actions } from '@ngrx/effects';
import { Action } from '@ngrx/store';
import { Observable } from 'rxjs/Observable';
import { Scheduler } from 'rxjs/Scheduler';
import { of } from 'rxjs/observable/of';
import { handleError } from './handleError';
import { GithubService } from '../services/github.service';

Why should you have a Browser Application behind a VPN?

Intro

Your company runs on a private network. Your employees access that network from home using a VPN. Every day your company relies on that connection to keep your data safe.

Definitions

Web: The public web is the collection of sites that start have a www prefix.
VPN: The private network that your company firewalls it's sensitive data behind.
Browser Application: Any application that runs in a web browser such as Chrome, Internet Explorer, Edge, and Firefox.

export const environment = {
production: false,
apiUrl: 'http://localhost:1337'
};
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { environment } from '../environments/environment';
@Injectable()
export class SkillsService {
constructor(private http: Http) { }
getSkills() {
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
@Injectable()
export class SkillsService {
constructor(private http: Http) { }
getSkills() {
return this.http.get('localhost:3000/skill/');
import { Component, OnInit } from '@angular/core';
import { UserService } from './user.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
@Injectable()
export class UserService {
private usersUrl = 'https://jsonplaceholder.typicode.com/users';