Skip to content

Commit 82e0055

Browse files
committed
make it pretty
1 parent a9fb465 commit 82e0055

File tree

9 files changed

+59
-62
lines changed

9 files changed

+59
-62
lines changed

audio-context/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ Specifying the `audioTrackCb` option when creating a browser allows you to custo
99
## Usage
1010

1111
```ts
12-
1312
// Client
1413
const hb = await Hyperbeam(computer_div, embed_url, {
15-
audioTrackCb: (track: MediaStreamTrack) => {
16-
// Create a Media Stream and more
17-
// https://developer.mozilla.org/en-US/docs/Web/API/Media_Capture_and_Streams_API
18-
}
14+
audioTrackCb: (track: MediaStreamTrack) => {
15+
// Create a Media Stream and more
16+
// https://developer.mozilla.org/en-US/docs/Web/API/Media_Capture_and_Streams_API
17+
},
1918
});
20-
2119
```
2220

2321
## Steps

audio-visualization/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,23 @@
33
Use the WebAudio API to visualize audio frequency data.
44

55
## Steps
6-
- Use ``npm i`` to install dependencies
6+
7+
- Use `npm i` to install dependencies
78
- Get your API key from [here](https://www.hyperbeam.com/dashboard)
89
- Set your API key by running the following commands in your terminal:
10+
911
```bash
1012
# Linux/Mac
1113
export HB_API_KEY=your-api-key
1214

1315
# Windows
1416
set HB_API_KEY=your-api-key
1517
```
16-
- Run ``npm start`` to start the server
17-
- Open ``localhost:8080`` in your browser
18+
19+
- Run `npm start` to start the server
20+
- Open `localhost:8080` in your browser
1821

1922
## Need help?
20-
- Send us an email at founders@hyperbeam.com
23+
24+
- Send us an email at founders@hyperbeam.com
2125
- Join our [Discord](https://discord.gg/D78RsGfQjq)

chrome-extension/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ In this example, we'll be loading the "Hello Extensions" extension in the Hyperb
1111
## Usage
1212

1313
```ts
14-
1514
// Server
1615

1716
// Create a form data object with the extension zip file
@@ -24,12 +23,9 @@ const headers = formData.getHeaders();
2423
headers["Authorization"] = `Bearer ${process.env.HB_API_KEY}`;
2524

2625
// Send a POST request to the Hyperbeam API with the form data
27-
const response = await post(
28-
"https://engine.hyperbeam.com/v0/vm",
29-
formData,
30-
{ headers }
31-
);
32-
26+
const response = await post("https://engine.hyperbeam.com/v0/vm", formData, {
27+
headers,
28+
});
3329
```
3430

3531
## Steps

multicursor/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ Multi-cursor is a feature that allows multiple users to control the browser simu
99
## Usage
1010

1111
```ts
12-
1312
// Client
1413
const hb = await Hyperbeam(container, embedUrl, {
15-
onCursor({ x, y, userId }) {
16-
// Render the cursor on the screen
17-
},
14+
onCursor({ x, y, userId }) {
15+
// Render the cursor on the screen
16+
},
1817
});
19-
2018
```
2119

2220
## Steps

resize/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ app.get("/computer", async (req, res) => {
2626
hide_cursor: true,
2727
width: width ? ~~width : 1280,
2828
height: height ? ~~height : 720,
29-
max_area: 1280*720
29+
max_area: 1280 * 720,
3030
};
3131
const resp = await axios.post(
3232
"https://engine.hyperbeam.com/v0/vm",

timeout/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ The Hyperbeam API lets you specify absolute, inactive and offine timeouts for yo
99
## Usage
1010

1111
```ts
12-
1312
// Server
1413
const response = await axios.post(
1514
"https://engine.hyperbeam.com/v0/vm",
@@ -26,8 +25,7 @@ const response = await axios.post(
2625
},
2726
},
2827
{ headers }
29-
);
30-
28+
);
3129
```
3230

3331
## Steps

troubleshooting/index.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@
77
<div style="font-family: sans-serif">
88
<button id="reconnect-btn">Reconnect</button>
99
</div>
10-
<div id="hyperbeam-container" style="height:720px;width:1280px"></div>
10+
<div id="hyperbeam-container" style="height: 720px; width: 1280px"></div>
1111
<div id="logs"></div>
1212
<script type="module">
13-
import Hyperbeam from "https://unpkg.com/@hyperbeam/web@latest/dist/index.js"
14-
const container = document.getElementById("hyperbeam-container")
15-
const reconnectBtn = document.getElementById("reconnect-btn")
16-
const logs = document.getElementById("logs")
13+
import Hyperbeam from "https://unpkg.com/@hyperbeam/web@latest/dist/index.js";
14+
const container = document.getElementById("hyperbeam-container");
15+
const reconnectBtn = document.getElementById("reconnect-btn");
16+
const logs = document.getElementById("logs");
1717

18-
const resp = await fetch("/computer")
19-
const data = await resp.json()
18+
const resp = await fetch("/computer");
19+
const data = await resp.json();
2020
const hb = await Hyperbeam(container, data.embed_url, {
2121
onConnectionStateChange({ state }) {
22-
const p = document.createElement("p")
23-
p.innerText = `CONNECTION STATE: ${state}`
24-
logs.appendChild(p)
25-
}
26-
})
22+
const p = document.createElement("p");
23+
p.innerText = `CONNECTION STATE: ${state}`;
24+
logs.appendChild(p);
25+
},
26+
});
2727
reconnectBtn.addEventListener("click", () => {
28-
hb.reconnect()
29-
})
28+
hb.reconnect();
29+
});
3030
</script>
3131
</body>
3232
</html>

troubleshooting/server.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
const path = require('path')
2-
const express = require('express')
3-
const axios = require('axios')
4-
const app = express()
1+
const path = require("path");
2+
const express = require("express");
3+
const axios = require("axios");
4+
const app = express();
55

6-
app.get('/', (req, res) => {
7-
res.sendFile(path.join(__dirname, '/index.html'))
8-
})
6+
app.get("/", (req, res) => {
7+
res.sendFile(path.join(__dirname, "/index.html"));
8+
});
99

1010
// Get a cloud computer object. If no object exists, create it.
11-
let computer
12-
app.get('/computer', async (req, res) => {
11+
let computer;
12+
app.get("/computer", async (req, res) => {
1313
if (computer) {
14-
res.send(computer)
15-
return
14+
res.send(computer);
15+
return;
1616
}
17-
const resp = await axios.post('https://engine.hyperbeam.com/v0/vm', {}, {
18-
headers: { 'Authorization': `Bearer ${process.env.HB_API_KEY}` }
19-
})
20-
computer = resp.data
21-
res.send(computer)
22-
})
17+
const resp = await axios.post(
18+
"https://engine.hyperbeam.com/v0/vm",
19+
{},
20+
{
21+
headers: { Authorization: `Bearer ${process.env.HB_API_KEY}` },
22+
}
23+
);
24+
computer = resp.data;
25+
res.send(computer);
26+
});
2327

2428
app.listen(8080, () => {
25-
console.log('Server start at http://localhost:8080')
26-
})
29+
console.log("Server start at http://localhost:8080");
30+
});

zoom/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99

1010
.toolbar {
1111
display: flex;
12-
12+
1313
justify-content: center;
1414
align-items: center;
15-
1615
}
1716

1817
.toolbar > .group {
1918
display: flex;
20-
19+
2120
align-items: center;
2221
margin: 0 10px;
2322
}

0 commit comments

Comments
 (0)