Skip to content

Instantly share code, notes, and snippets.

RxJS Exam Notes

1. Introduction to Reactive Programming and Observables

1.1 Basics of Reactive Programming

  • Reactive programming is a programming paradigm that focuses on data streams and the propagation of changes.

1.2 What is RxJS?

  • RxJS is a library for reactive programming using Observables, to make it easier to compose asynchronous or callback-based code.

1.3 Core Concepts: Observables, Observers, and Subscriptions

Webpack POC recipie

Installation

  • Install nodejs. Choose the package labeled Recommended for Most Users
  • Create a folder for this project and open a command prompt there.
  • Create a local package.json file by running npm init
    • Choose all the default options.
    • You should have the package.json file afterward
  • Install webpack globaly by running npm install webpack -g
  • Install webpack localy by running npm install webpack -S
@coreypnorris
coreypnorris / aps-upload-file-directive.md
Last active December 20, 2016 23:08
Custom directive for uploading files with material design styling.

GitHub Logo

Installation

  • Run yeoman command yo angular:directive apsUploadFile
  • Create the html template file app\views\directives\apsuploadfile.html
<input id="apsFileInput" type="file" class="ng-hide">

<md-button id="apsUploadButton" class="md-raised md-primary" aria-label="attach_file">
  Choose file
@coreypnorris
coreypnorris / Inject a service into controller test.md
Last active January 12, 2017 11:36
Inject a service into controller test

Given a controller that uses the $location service

'use strict';

/**
 * @ngdoc function
 * @name categoryManagerApp.controller:CategoryCtrl
 * @description
 * # CategoryCtrl
 * Controller of the categoryManagerApp
@coreypnorris
coreypnorris / basic-modal-in-angular-with-uibootstrap.md
Last active January 12, 2017 11:36
Create a basic modal in Angular using ui.bootstrap
  • Install angular-bootstrap via bower bower install angular-bootstrap --save
  • In app/scripts/app.js add ui.bootstrap as a dependency
angular
  .module('categoryManagerApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
@coreypnorris
coreypnorris / Create angular directive with unit tests.md
Last active October 1, 2019 01:27
Create angular directive with unit test

Basic directive

  • Run generator command yo angular:directive myDirective.
  • Run gulp test to ensure tests pass.

Refactor to handle passed-in objects

Given you want to pass in the following object {realName:'Steve Rogers', alias:'Captain America'}
  • Add scope property to the app/scripts/directives/mydirective.js file.
'use strict';
@coreypnorris
coreypnorris / gist:08129d2108975f5be3ea
Last active November 24, 2015 03:57
zip_to_lat_lng
This file has been truncated, but you can view the full file.
[{'00601':{'lat':18.180555,'lng':-66.749961},
'00602':{'lat':18.361945,'lng':-67.175597},
'00603':{'lat':18.455183,'lng':-67.119887},
'00606':{'lat':18.158345,'lng':-66.932911},
'00610':{'lat':18.295366,'lng':-67.125135},
'00612':{'lat':18.402253,'lng':-66.711397},
'00616':{'lat':18.420412,'lng':-66.671979},
'00617':{'lat':18.445147,'lng':-66.559696},
'00622':{'lat':17.991245,'lng':-67.153993},
'00623':{'lat':18.083361,'lng':-67.153897},
@coreypnorris
coreypnorris / gist:37f051c4a15c35fbc04f
Last active August 29, 2015 14:22
Open Google Chrome in Ruby script

example.rb

system("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", 'www.twitter.com')
@coreypnorris
coreypnorris / gist:f725197d69b1d48a3074
Created June 2, 2015 14:19
Google api in Ruby on Windows: certificate verify failed solution

Open the command line and run the following commands:

  • curl -o c:\cacert.pem http://curl.haxx.se/ca/cacert.pem
  • set SSL_CERT_FILE=c:\cacert.pem
@coreypnorris
coreypnorris / FilterConfig.cs
Created May 7, 2015 19:29
Foundation for a logging file
// in App_Start/FilterConfig.cs
using System.Web;
using System.Web.Mvc;
using OdeToFood.Filters;
namespace OdeToFood
{
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)