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" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
<script src="script.js" defer type="module"></script> | |
</head> | |
<body> |
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
router.Get("/stream/{id}", func(w http.ResponseWriter, r *http.Request) { | |
w.WriteHeader(200) | |
id := chi.URLParam(r, "id") | |
sse := datastar.NewSSE(w, r) | |
_ = sse | |
ctx := bee.WithJetStream(r.Context(), js) | |
ctx = bee.WithNats(ctx, nc) | |
agg := &Aggregate{} |
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
package replayhandler | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"time" | |
"github.com/ituoga/iot/gen" | |
"github.com/nats-io/nats.go" |
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
package main | |
import ( | |
"io" | |
"os/exec" | |
"github.com/nats-io/nats.go" | |
) | |
type NWriter struct { |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"strings" | |
"time" | |
"github.com/ituoga/the-system/pkg/tools" |
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
#include <TimerOne.h> | |
const int encoderPinA = 2; // Connected to interrupt 0 (pin 2) | |
const int encoderPinB = 3; // Connected to interrupt 1 (pin 3) | |
const int stepPin = 9; | |
const int dirPin = 8; | |
// Variables to track encoder state | |
volatile int32_t encoderPositionX = 0; | |
volatile int32_t encoderPositionY = 0; | |
volatile int32_t encoderPositionZ = 0; | |
volatile bool lastEncodedState = false; |
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
<html> | |
<head> | |
<meta name="theme-color" content="#0d085c"/> | |
<link rel="manifest" href="/manifest.json"/> | |
</head> |
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
from flask import Flask, Response | |
import time | |
app = Flask(__name__) | |
def root_dir(): # pragma: no cover | |
return os.path.abspath(os.path.dirname(__file__)) | |
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
<script> | |
class MyArray extends HTMLElement { | |
constructor() { | |
super(); | |
this.store = {}; | |
const template = document.createElement("template"); | |
const id = Math.random().toString(36).substr(2, 9); | |
template.innerHTML = `<div id="input-${id}">hi</div>`; | |
this.shadow = this.attachShadow({ mode: "open" }); | |
this.shadow.appendChild(template.content.cloneNode(true)); |
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
class MyCustomElement extends HTMLElement { | |
constructor() { | |
super(); | |
const template = document.createElement('template'); | |
template.id = 'pool-calculator-template'; | |
template.innerHTML = ` | |
<input type="text" id="input"/> | |
`; | |
// this.appendChild(template); |
NewerOlder