Skip to content

Instantly share code, notes, and snippets.

View weirdyang's full-sized avatar
💭
I may be slow to respond.

weirdyang

💭
I may be slow to respond.
  • Singapore
View GitHub Profile
@aashari
aashari / 00 - Cursor AI Prompting Rules.md
Last active December 10, 2025 16:25
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

@modamodamoda
modamodamoda / index.js
Created July 28, 2021 05:05
Get olympic medals per capita
// npm install node-fetch cheerio
const fetch = require('node-fetch'), cheerio = require('cheerio');
const els = ['rank', 'country', 'gold', 'silver', 'bronze', 'total', 'rbt', 'code'];
var countries = [];
var aliases = {'Chinese Taipei': 'Taiwan', 'Hong Kong, China': 'Hong Kong'};
fetch('https://olympics.com/tokyo-2020/olympic-games/en/results/all-sports/medal-standings.htm').then(res => res.text()).then(text => {
using System.Collections.Generic;
using System.Linq;
using Telerik.Sitefinity.Modules.Libraries;
using Telerik.Sitefinity.Modules.News;
using Telerik.Sitefinity.Multisite;
using Telerik.Sitefinity.Services;
namespace SitefinityWebApp
{
public partial class GetProvidersExample
@VesselinVassilev
VesselinVassilev / NavigationView.Horizontal.cshtml
Last active June 15, 2022 12:44
Navigation view with direct links to redirect pages
@using Telerik.Sitefinity.Pages.Model;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@using Telerik.Sitefinity.Web;
@using Telerik.Sitefinity.Frontend.Navigation.Mvc.Models;
@model Telerik.Sitefinity.Frontend.Navigation.Mvc.Models.INavigationModel
<ul class="navbar-nav mr-auto mt-lg-0 pr-0 @Model.CssClass">
<li class="nav-close"><a href="#"><i class="fa fa-times" aria-hidden="true"></i></a></li>
@foreach (var node in Model.Nodes)
{
@Vovan-VE
Vovan-VE / fix-lists.js
Created June 20, 2019 00:09
Quill Lists Fix (redux ready)
/*
* Quill 1.* cannot next block elements inside <li> including nested <ul>,<ol>.
* To achieve nested lists it uses flat linear lists with CSS class `ql-indent-\d+` on <li>.
* Nesting <ul> inside <ol> or vice-versa cause topmost list to break in two adjacent lists.
*
* There is the only solution: fix bad HTML after getting it from Quill and break it back before
* passing to Quill again for editing.
*/
const mkNode = (tagName = 'div') => document.createElement(tagName);
@chengkiang
chengkiang / paynow.js
Last active November 14, 2025 23:23
SG PayNow QR Code Generator Sample
String.prototype.padLeft = function (n, str) {
if (n < String(this).length) {
return this.toString();
}
else {
return Array(n - String(this).length + 1).join(str || '0') + this;
}
}
function crc16(s) {
@richlander
richlander / json-document.cs
Created January 29, 2019 17:21
Sample Usage of JsonDocument and JsonElement
static double ParseJson()
{
const string json = " [ { \"name\": \"John\" }, [ \"425-000-1212\", 15 ], { \"grades\": [ 90, 80, 100, 75 ] } ]";
double average = -1;
using (JsonDocument doc = JsonDocument.Parse(json))
{
JsonElement root = doc.RootElement;
JsonElement info = root[1];
@zebzhao
zebzhao / query2sql.html
Created November 19, 2018 20:38
Example of converting Angular 2 query builder object to SQL
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<script>
var data = {
@SndrSchnklshk
SndrSchnklshk / GenerateChecksum.cs
Last active August 27, 2024 13:59
Generate a simple checksum in C#
// Generates a Checksum
// EXAMPLE: Input="Hello World!!" -> Output="5E"
public static string GenerateChecksum(string input)
{
byte[] bytes = Encoding.ASCII.GetBytes(input);
byte result = 0;
foreach (byte c in bytes)
result += c;
result &= 0xff;
return result.ToString("X2");
@analogrelay
analogrelay / CommandLineException.cs
Last active March 22, 2024 11:50
My Command Line Template
using System;
using System.Runtime.Serialization;
namespace MyTool
{
[Serializable]
internal class CommandLineException : Exception
{
public CommandLineException()
{