Skip to content

Instantly share code, notes, and snippets.

View vivekmaru's full-sized avatar
🖥️
Focusing

Vivek Maru vivekmaru

🖥️
Focusing
  • Deputy
  • Sydney, Australia
View GitHub Profile
@vivekmaru
vivekmaru / you_couldve_invented_openclaw.md
Created February 13, 2026 02:06 — forked from dabit3/you_couldve_invented_openclaw.md
You Could've Invented OpenClaw

What makes OpenClaw powerful is surprisingly simple: it's a gateway that connects an AI agent to your messaging apps, gives it tools to interact with your computer, and lets it remember who you are across conversations.

The complexity comes from handling multiple channels simultaneously, managing persistent sessions, coordinating multiple agents, and making the whole thing reliable enough to run 24/7 on your machine.

In this post, I'll start from scratch and build up to OpenClaw's architecture step by step, showing how you could have invented it yourself from first principles, using nothing but a messaging API, an LLM, and the desire to make AI actually useful outside the chat window.

End goal: understand how persistent AI assistants work, so you can build your own.

First, let's establish the problem

@vivekmaru
vivekmaru / setup.sh
Last active November 14, 2025 11:17
#!/usr/bin/env bash
set -e
# Ensure we're running with bash
if [ -z "$BASH_VERSION" ]; then
echo "Error: This script requires bash. Please run with: bash $0"
exit 1
fi
# Colors for output
@vivekmaru
vivekmaru / helper.js
Created May 5, 2019 12:26
Helper functions
function url_clean(url) {
return url.toLowerCase()//
.replace(/^\s+|\s+$/g, "")// trim leading and trailing spaces
.replace(/[_|\s]+/g, "-")// change all spaces and underscores to a hyphen
.replace(/[^a-zF0-9-\/]+/g, "")// remove non alpha, digit, '-', '/' chars
.replace(/[-]+/g, "-")// replace multiple hyphens with one
.replace(/^-+|-+$/g, ""); // trim leading and trailing hyphens
}
@vivekmaru
vivekmaru / docker_commands.md
Created September 20, 2018 00:44 — forked from 64lines/docker_commands.md
[DOCKER] Docker Useful Commands

Useful Docker commands

docker build -t friendlyname .                                       # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname                                   # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname                                # Same thing, but in detached mode
docker run -d -p 4000:80 -n containername friendlyname               # With the container name
docker run -dit --name apache2 apache2                               # Run in the background
docker ps                                                            # See a list of all running containers
docker stop <hash>                                                   # Gracefully stop the specified container
@vivekmaru
vivekmaru / JS Quiz Answer Explanations.md
Last active September 30, 2017 08:43 — forked from MattSurabian/JS Quiz Answer Explanations.md
My attempt to explain the answers for David Shariff's feelings hurting JS quiz found at: davidshariff.com/js-quiz/

Are your feelings hurt?

If you rushed through David Shariff's JS Quiz or are just new to JS they might be. I know mine were. After I dried my eyes, I took the quiz again, this time very slowly trying to get at the meat behind each answer. Below is my attempt to explain each question's answer and offer some interesting permutations so that others can move beyond their hurt feelings and come out the other side better JS developers.

I initially thought I'd turn this into a blog post but think it's probably better as a gist.

Question #1

Don't over think it.

var foo = function foo() {
@vivekmaru
vivekmaru / SCSS.md
Last active February 17, 2018 09:27 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso