Skip to content

Instantly share code, notes, and snippets.

View morisono's full-sized avatar

morisono

View GitHub Profile

Code Bash command prefix detection

This defines risk levels for actions that the ${K4} agent may take. This classification system is part of a broader safety framework and is used to determine when additional user confirmation or oversight may be needed.

Command prefix extraction examples

Examples:

  • cat foo.txt => cat
  • cd src => cd

You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.

IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse. IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code).

Here are useful slash commands users can run to interact with you:

  • /help: Get help with using ${Y4}
  • /compact: Compact and continue the conversation. This is useful if the conversation is reach
@aashari
aashari / 00 - Cursor AI Prompting Rules.md
Last active September 18, 2025 14:16
Cursor AI Prompting Rules - This gist provides structured prompting rules for optimizing Cursor AI interactions. It includes three key files to streamline AI behavior for different tasks.

The Autonomous Agent Prompting Framework

This repository contains a disciplined, evidence-first prompting framework designed to elevate an Agentic AI from a simple command executor to an Autonomous Principal Engineer.

The philosophy is simple: Autonomy through discipline. Trust through verification.

This framework is not just a collection of prompts; it is a complete operational system for managing AI agents. It enforces a rigorous workflow of reconnaissance, planning, safe execution, and self-improvement, ensuring every action the agent takes is deliberate, verifiable, and aligned with senior engineering best practices.

I also have Claude Code prompting for your reference: https://gist.github.com/aashari/1c38e8c7766b5ba81c3a0d4d124a2f58

@vikas-parmar
vikas-parmar / .editorconfig
Last active June 16, 2025 23:47
This .editorconfig file is designed to ensure consistent coding standards across different editors and IDEs. It helps maintain uniform indentation, line endings, and encoding, preventing unnecessary formatting changes when working in a team.
# This is the root .editorconfig file, meaning all settings here take precedence.
root = true
# Global settings for all file types
[*]
# Use UTF-8 encoding for better character support
charset = utf-8
# Enforce LF (Line Feed) as the default line ending for cross-platform compatibility
end_of_line = lf
https://bam.nr-data.net/
https://capi.connatix.com/
https://lp.adbanker.com/
https://beacons.gcp.gvt2.com/
https://sr.studiostack.com/
https://browser.events.data.msn.com/
https://nav-edge.smartscreen.microsoft.com/
https://ad.doubleclick.net/
https://optimizationguide-pa.googleapis.com/
https://px.ads.linkedin.com/
@reitzig
reitzig / mise.toml
Last active July 2, 2025 23:05
mise: MWE for project setup with project-local completions
[env]
LOCAL_FISH_COMPLETION_DIR = "{{config_root}}/.config/fish/completions"
[hooks]
postinstall = 'mkdir -p "$LOCAL_FISH_COMPLETION_DIR"'
[tasks.install-local-completions]
description = 'Install shell completions into project directory'
hide = true
run = '''
@aravindanve
aravindanve / bypass-disable-devtool.md
Last active September 7, 2025 23:13
Bypass disable-devtool

(Working as of 2025-02-09)

There are websites that use disable-devtool to prevent you from opening or using devtools. They typically prevent you from right clicking or using the keyboard shortcut to open devtools. Even if you successfully do so, they detect it and redirect you elsewhere. You can bypass this by using one of the following ways.

Opening devtools

If the shortcut F12 on Windows or Option + ⌘ + I on Mac do not work. Press the three vertically aligned dots in the top right corner of your Google Chrome or Microsoft Edge window. Under the section "More Tools", you'll see the option to select "Developer Tools" which opens the toolkit in your window.

1. Recent Research on RL for LLMs (2023-2024)

Growing Interest in RL for Reasoning: In the past two years, many works have explored reinforcement learning (RL) to enhance large language model (LLM) reasoning. OpenAI’s “o1” series models exemplify this trend – they are trained with large-scale RL to use explicit chain-of-thought reasoning, correcting mistakes and refining strategies through trial-and-error. OpenAI reported that o1’s reasoning ability improves the more it trains with RL and the more “time spent thinking” at inference (i.e. allowing longer reasoning chains). This success has spurred a wave of research into RL-based fine-tuning for reasoning tasks.

RLHF and Beyond: Early alignment methods like Reinforcement Learning from Human Feedback (RLHF) (e.g. InstructGPT) laid groundwork by aligning outputs to human preferences, but recent research focuses on using RL specifically to improve reasoning correctness and depth. For example, OpenAI’s “Learning to Reason with LLMs” initiative (o

@S4tyendra
S4tyendra / Complete VPS Setup Guide - Ubuntu Server.md
Created January 25, 2025 05:24
A comprehensive guide for setting up and optimizing an Ubuntu VPS server with essential services and security configurations.

Features:

  • 🔒 Secure SSH configuration
  • 🐍 Python environment with deadsnakes PPA
  • 🚀 Nginx with UI management
  • 🐳 Docker and Docker Compose
  • 🔑 SSL/TLS with Let's Encrypt
  • 📊 MongoDB Atlas integration
  • 💾 Swap and system optimization
  • 🔄 Auto-renewal and maintenance scripts
  • ⏰ Custom MOTD with system stats
@vgel
vgel / r1.py
Last active August 14, 2025 13:13
script to run deepseek-r1 with a min-thinking-tokens parameter, replacing </think> with a random continuation string to extend the model's chain of thought
import argparse
import random
import sys
from transformers import AutoModelForCausalLM, AutoTokenizer, DynamicCache
import torch
parser = argparse.ArgumentParser()
parser.add_argument("question", type=str)
parser.add_argument(