Skip to content

Instantly share code, notes, and snippets.

View rohit20001221's full-sized avatar

rohit20001221

View GitHub Profile
class ReactiveState:
def __init__(self):
self.subscribers = set()
self.count = 0
def subscribe(self, cb):
self.subscribers.add(cb)
return lambda: self.subscribers.remove(cb)
def _notify(self):
import json
from typing import TypedDict
from langchain.chat_models import init_chat_model
from langchain_core.tools import tool
from langgraph.prebuilt import ToolNode
from langgraph.graph import StateGraph, START, END
CHAT_MODEL = "llama3.2"
<html>
<head>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""
/>
<script
package main
import (
"context"
"log"
"net/http"
"strconv"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
package middlewares
import (
"crypto/sha256"
"crypto/subtle"
"net/http"
)
func NewBasicAuthMiddleware(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ansible-galaxy collection install azure.azcollection
pip install -r https://raw.githubusercontent.com/ansible-collections/azure.azcollection/main/requirements-azure.txt
---
- name: Create an Azure VM in East US with specific configurations
hosts: localhost
connection: local
gather_facts: no
vars:
<html>
<head>
<script src="./go_wasm.js"></script>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(
fetch("main.wasm"),
go.importObject,
).then((result) => {
//go:build js && wasm
// +build js,wasm
package main
import (
"log"
)
func main() {
{
"name": "web-assembly",
"version": "1.0.0",
"main": "go_wasm.js",
"scripts": {
"build": "GOOS=js GOARCH=wasm go build -o main.wasm .",
"create:js": "cp \"$(go env GOROOT)/misc/wasm/wasm_exec.js\" ./go_wasm.js"
},
"keywords": [],
"author": "",
<script type="importmap" src="importmap.json"></script>