Instantly share code, notes, and snippets.


Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.


Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')



Introduction to Angular

Angular (aka Angular 2) is a new framework completely rewritten from the ground up, replacing the famous AngularJS framework (aka Angular 1.x).

More that just a framework, Angular should now be considered as a whole platform which comes with a complete set of tools, like its own CLI, debug utilities or performance tools.

Getting started


Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
View gist:bc0547dd31eded09e44575015f475c93
echo "Building Ionic/Cordova iOS release..."
ionic build --release ios
# Save current directory and cd to other dir
pushd platforms/ios/
# Build archive
xcodebuild -scheme "MyApp" -configuration Release clean archive
# Can also specify archive path:
View angular-ios9-uiwebview.patch.js
* ================== angular-ios9-uiwebview.patch.js v1.1.1 ==================
* This patch works around iOS9 UIWebView regression that causes infinite digest
* errors in Angular.
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular
* have the workaround baked in.
* To apply this patch load/bundle this file with your application and add a
View Commands
EU Mobile Market Share
Android 71.3% - developed with Java using Android Studio
Apple 17.5% - developed with Objective C or Swift using Xcode
Windows 10.0% - developed with C# using Visual Studio
Start with Mac Hardware
Install Xcode (required) & Android Studio (optional - requires Java JDK)
View server.js
'use strict';
var events = require('events');
var cors = require('cors');
var express = require('express');
var request = require('request');
var xml2json = require('xml2json');
var app = express();
var event = new events.EventEmitter();
View format-input.htm
<!doctype html>
<html ng-app="td">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src=""></script>
<body ng-controller="fundingCtrl">
<input type="tel" ng-model="amount" td-formatting="amount:GBP" class="td-funding-amount-input" placeholder="0.00" />
<div ng-bind="amount"></div>
<input type="tel" ng-model="creditcard" td-formatting="creditcard" class="td-funding-creditcard-input" placeholder="Visa or MasterCard" />