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')
(function(){ | |
'use strict'; | |
angular | |
.module('app', []) | |
.directive('ngInsert', ngInsert) | |
.directive('ngInsert', ngInsertFillContentDirective); | |
ngInsert = ['$templateRequest', '$anchorScroll', '$animate', '$sce']; | |
function ngInsert($templateRequest, $anchorScroll, $animate, $sce) { |
#!/usr/bin/env ruby | |
require 'json' | |
def parse(uri) | |
JSON.parse `curl -s #{uri}`.gsub(/\/\*(?:(?!\*\/).)*\*\//m, '').strip.gsub(/^callback\(/, '').gsub(/\);/, '').gsub(/([a-zA-Z]+[0-9]*):/, '"\1":') | |
end | |
puts %w( | |
platform |
function isObject(value) { | |
// Avoid an old bug in Chrome 19-20 | |
// See https://code.google.com/p/v8/issues/detail?id=2291 | |
const type = typeof value; | |
return type === 'function' || (!!value && type === 'object'); | |
} | |
function ofPropertyChanges(obj, key) { | |
if (isObject(obj) === false) { | |
return Rx.Observable.return(undefined); |
# Add the "https://github.com/jwt/ruby-jwt" gem to your "Gemfile" | |
gem 'jwt' |
/* | |
Usage: | |
var jsoncheck = require('./wantsJSON') // path to file with this middleware function | |
app.use(jsoncheck) | |
app.get('/', function(req,res,next){ | |
if (req.wantsJSON) { | |
// serve JSON | |
} | |
if (req.wantsHTML) { |
# Example Dockerfile | |
FROM hello-world |
# Convert the .cer file into a .pem file: | |
$ openssl x509 -in aps_development.cer -inform der -out PushChatCert.pem | |
# Convert the private key’s .p12 file into a .pem file: | |
$ openssl pkcs12 -nocerts -in PushChatKey.p12 -out PushChatKey.pem | |
# Finally, combine the certificate and key into a single .pem file | |
$ cat PushChatCert.pem PushChatKey.pem > ck.pem | |
# At this point it’s a good idea to test whether the certificate works. |
Docker does not run natively on OSX, only Linux. Docker Machine was created to add a Linux VM environment to run Docker containers on OSX. Install using Homebrew:
brew install docker
brew install docker-machine
docker-machine create
source 'http://rubygems.org' | |
gem "hiredis", "~> 0.3.1" | |
gem "em-synchrony" | |
gem 'em-hiredis' | |
#gem "redis", "~> 2.2.0", :require => ["redis/connection/synchrony", "redis"] | |
gem "goliath" | |
#gem 'em-synchrony', :git => 'git://github.com/igrigorik/em-synchrony.git' |