This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: src/index.js - Derived from: | |
// RxJS in Action (2017, Manning), 978-1-617-29341-2 | |
// by Paul P. Daniels and Luis Atencio | |
// Listings: | |
// 10.6 Plugging into the middleware (p.297) | |
// 10.7 Implementing custom ofType operator (p.299) | |
// 10.8 Building your middleware (p.299) | |
// 10.9 Building the application (p.302) | |
// | |
// Variation B: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: src/index.js - Derived from: | |
// RxJS in Action (2017, Manning), 978-1-617-29341-2 | |
// by Paul P. Daniels and Luis Atencio | |
// Listings: | |
// 10.6 Plugging into the middleware (p.297) | |
// 10.7 Implementing custom ofType operator (p.299) | |
// 10.8 Building your middleware (p.299) | |
// 10.9 Building the application (p.302) | |
// | |
// Variation C: Eliminate Redux using only RxJS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: src/AddressInput.js | |
import {getPropPathValue} from './Misc'; | |
// --- DOM hook | |
const _addressInput = document.querySelector('main input[type="text"]'); | |
function selectAddress(event) { | |
const name = getPropPathValue(event, ['target','constructor','name'], null); | |
if(name == 'HTMLInputElement') { | |
event.target.select(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: src/AddressInput.js | |
import {getPropPathValue} from './Misc'; | |
// --- DOM hook | |
const _addressInput = document.querySelector('main input[type="text"]'); | |
function selectAddress(event) { | |
const name = getPropPathValue(event, ['target','constructor','name'], null); | |
if(name == 'HTMLInputElement') { | |
event.target.select(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: src/Misc.js | |
export const PING = 'ping'; | |
export const PONG = 'pong'; | |
export function now() { | |
return new Date().toLocaleTimeString(); | |
} | |
export function toTextFrom(from) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Quickshot</title> | |
</head> | |
<body> | |
<p>Open the Console!</p> | |
<p> | |
<ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
file: src/ServerEvents.js | |
Previous: | |
- part 3: https://gist.github.com/peerreynders/d59d37dd47016a932ee9c786e3817560 | |
- part 2: https://gist.github.com/peerreynders/a0965c47cce31fb6a6677b90f0ca71cc | |
- part 1: https://gist.github.com/peerreynders/474145762df0708fe78bf39b548fab00 | |
see also: https://gist.github.com/peerreynders/412911579e4a0c485f67a122634cffe2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FromPipe do | |
# | |
# Use a helper script "from_pipe_forward" to communicate | |
# contents from the named pipe to the port | |
# | |
@pipe_name "/tmp/testpipe" | |
@from_pipe_forward "./from_pipe_forward" | |
@from_pipe_clean "./from_pipe_clean" | |
# * terminate potential zombie OS process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FromPipe do | |
# | |
# Use a helper script "from_pipe_release" to | |
# release/request each line read from the | |
# named pipe - effectively implementing a | |
# crude backpressure mechanism | |
# | |
@pipe_name "/tmp/testpipe" | |
@from_pipe_release "./from_pipe_release" | |
@from_pipe_clean "./from_pipe_clean" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FromPipe do | |
# | |
# NOTE: this use of ports is based on UNDOCUMENTED functionality | |
# of the open_port/2 function - i.e. could stop working | |
# in any future release | |
# http://erlang.org/doc/man/erlang.html#open_port-2 | |
# | |
# See also: | |
# Erlang and Named Pipes | |
# https://gist.github.com/jaredmorrow/1c342c6e9156eddd20b2 |