Skip to content

Instantly share code, notes, and snippets.

View cjavdev's full-sized avatar
👉

CJ Avilla cjavdev

👉
View GitHub Profile
@cjavdev
cjavdev / bundle-stainless-config.sh
Created April 17, 2026 17:54
Stainless bundle from config repo
#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<EOF
Usage: $0 <github-repo-url> [output-zip]
Downloads a Stainless config repo from GitHub and packages it into a zip
containing a top-level 'stainless/' directory with:
- openapi.json (any *.json / *.yaml / *.yml OpenAPI spec in the repo)
---
name: beeper
description: >
Manage messaging across platforms (WhatsApp, Telegram, Twitter/X, etc.) using the Beeper Desktop CLI.
Use when the user wants to send messages, check messages, search chats, list accounts, manage reactions,
upload attachments, or interact with any messaging platform through Beeper.
triggers:
- send message
- beeper
- check messages
@cjavdev
cjavdev / SKILL.md
Created January 25, 2026 17:33
Skill for fixing render deployments with the render MCP server
name fix-render-deploy
description Diagnose and fix failing Render deployments for the current project. Fetches deployment logs, identifies the root cause of failures, and creates a PR with the fix.

Fix Render Deployment

Diagnose and fix failing Render deployments for the current project by analyzing logs and creating a pull request with the fix.

Workflow

@cjavdev
cjavdev / server.ts
Created August 5, 2025 14:19
Minimal MCP server.ts
import express, { Request, Response } from "express";
import { randomUUID } from "crypto";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";
const app = express();
app.use(express.json());
@cjavdev
cjavdev / xsolla_webhooks.py
Created June 16, 2025 12:07
XSolla Webhook Example
@app.route('/webhooks', methods=['POST'])
def xsolla_webhook():
# Get the signature from headers
signature = request.headers.get('Authorization')
# Get the raw request body as a string:
payload = request.data.decode('utf-8')
payload_with_key = "%s%s" % (payload, XSOLLA_WH_KEY)
# Verify the webhook signature if provided
{
"data": [
{
"readingId": "fuelLevel",
"entityId": "123456",
"entityType": "sensor",
"value": {
"fuelLevelLiters": 47.0,
"fuelLevelGallons": 12.4161,
},
@cjavdev
cjavdev / keybindings.json
Last active September 5, 2024 13:42
hjlk vim nav and test runner in vs code
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+e",
"command": "-extension.vim_ctrl+e",
"when": "editorTextFocus && vim.active && vim.use<C-e> && !inDebugRepl"
},
{
"key": "ctrl+a",
"command": "-extension.vim_ctrl+a",
@cjavdev
cjavdev / test.rb
Created August 27, 2024 13:48
Rails 7.2 ApplicationSystemTestCase missing host
# config/environments/test.rb
# ...
# Already had this:
config.action_mailer.default_url_options = { host: "www.example.com" }
# Had to add this:
Rails.application.routes.default_url_options = { host: "www.example.com" }
rails r 'require "redis"; redis = Redis.new; pattern = "jbuilder/*"; cursor = 0; loop do;cursor, keys = redis.scan(cursor, match: pattern);redis.del(*keys) unless keys.empty?;break if cursor == "0";end;'