Skip to content

Instantly share code, notes, and snippets.

View bmorelli25's full-sized avatar
📚
Writing docs

Brandon Morelli bmorelli25

📚
Writing docs
View GitHub Profile
@bmorelli25
bmorelli25 / run-heartbeat-7.0.0-rc1.md
Created April 1, 2019 19:28
run-heartbeat-7.0.0-rc1
# WITH COMMENTS
apm-server:
# RUM
rum:
# To enable real user monitoring (RUM) support set this to true.
enabled: true
# If you're using version 0.x or 1.x of the RUM agent and APM Server <= 6.4
# Rate limit per second and IP address for requests sent to the RUM endpoint.

All three options below produce the same output regardless of which attributes are set

Option 1 Uses "," (or) in ifndef to check for two attributes

The APM documentation relies too heavily on current. This has created a number of issues, including bad internal and external links when pages move, or docs that cross-link to incorrect versions. As an example, the 6.3 APM Server Overview documentation links to the current versions of both the Node.js and Python agents, even though they are not compatible.

The temporary fix to this solution was to set up shared attributes in the docs repo for older versions of documentation:

  • shared/attributes.asciidoc:
:apm-server-ref:       https://www.elastic.co/guide/en/apm/server/{branch}
:apm-server-ref-62:    https://www.elastic.co/guide/en/apm/server/6.2
:apm-server-ref-64:    https://www.elastic.co/guide/en/apm/server/6.4
:apm-py-ref:           https://www.elastic.co/guide/en/apm/agent/python/current
:apm-py-ref-3x: https://www.elastic.co/guide/en/apm/agent/python/3.x
<img srcset="image-320w.jpg 1x,
image-640w.jpg 2x
src="image-320w.jpg" alt="Image">
<img srcset="image-320w.jpg 320w,
image-480w.jpg 480w,
image-800w.jpg 800w"
sizes="(max-width: 320px) 300px,
(max-width: 480px) 440px,
800px"
src="image-800w.jpg" alt="Image">
<h2>XYZ Product Detail</h2>
<!-- DO NOT USE this as it will load the full size image and the browser does the resize -->
<img src="image.jpg" alt="full size image" width="800" height="1000" />
<!-- USE a resized image where the resizing is done from the server and there is no need of browser-side resizing-->
<img src="resized_800x1000_image.jpg" alt="resized image" />
@bmorelli25
bmorelli25 / server.js
Created July 2, 2018 14:50
Realtime Paint Application - server
// server.js
require('dotenv').config();
...
app.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
...
});
@bmorelli25
bmorelli25 / canvas.js
Created July 2, 2018 14:49
Realtime Paint Application - canvas
// canvas.js
...
import Pusher from 'pusher-js';
class Canvas extends Component {
constructor(props) {
super(props);
...
this.pusher = new Pusher('PUSHER_KEY', {
cluster: 'eu',
@bmorelli25
bmorelli25 / index.html
Created July 2, 2018 14:48
Realtime Paint Application
<!-- index.html -->
...
<head>
...
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel="stylesheet">
</head>
...