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')
#!/usr/bin/env bash | |
# Connect to the server.. | |
# ssh username@server_ip | |
mkdir ~/.local; | |
# Download source and build libevent | |
cd /tmp; | |
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz; | |
tar xvfz libevent-2.1.8-stable.tar.gz; |
import React, { Component } from "react"; | |
import { render } from "react-dom"; | |
import "./index.css"; | |
class Widget extends Component { | |
state = { text: "" }; | |
handleChange = (e) => { | |
this.setState({ text: e.target.value }); | |
}; | |
render() { |
// | |
// Smooth scroll-to inspired by: | |
// http://stackoverflow.com/a/24559613/728480 | |
// | |
module.exports = function (scrollTo, scrollDuration) { | |
// | |
// Set a default for where we're scrolling to | |
// |
// https://codepen.io/rachsmith/pen/yYZapV | |
/* HTML | |
<canvas id="canvas"></canvas> | |
<h1>Follow the mouse - with lerp</h1> | |
*/ |
class MouseOverComponent extends React.Component { | |
componentDidMount() { | |
this.mouseMove$ = Rx.Observable.fromEvent(this.mouseDiv, "mousemove") | |
.throttleTime(1000) | |
.subscribe(() => console.log("throttled mouse move")); | |
} | |
componentWillUnmount() { | |
this.mouseMove$.unsubscribe(); |
# Tell system when Xcode utilities live: | |
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer | |
# Set "opendiff" as the default mergetool globally: | |
git config --global merge.tool opendiff |
// finished version of https://youtu.be/yIcve5wIuAg | |
function add(...args) { | |
function curriedAdd(...args2) { | |
return add(...args, ...args2) | |
} | |
curriedAdd.value = args.reduce((total, current) => total + current) | |
return curriedAdd | |
} |
// | |
// YouTubeMusic.plist | |
// BeardedSpice | |
// | |
// Created by Vladislav Gapurov on 07/28/18 | |
// Copyright (c) 2013 Tyler Rhodes / Jose Falcon. All rights reserved. | |
// | |
BSStrategy = { | |
version: 1, |