Skip to content

Instantly share code, notes, and snippets.

View mguinada's full-sized avatar

Miguel Guinada mguinada

  • BeBanjo
  • Lisbon, Portugal
View GitHub Profile
@mguinada
mguinada / prompt-for-agents.md-generation.md
Created October 16, 2025 22:01 — forked from rodion-m/prompt-for-agents.md-generation.md
Prompt for AGENTS.md file creating
### ABOUT
Modern AI coding tools converge on a simple idea: give the agent a **single, well-structured Markdown file that explains how your repo β€œworks,”** and prepend that file to every LLM call so the agent never has to guess about architecture, commands, or conventions. Community gists, RFCs, and vendor playbooks all recommend the same core sectionsβ€”overview, project map, build/test scripts, code style, security, and guardrailsβ€”plus support for nested AGENTS.md files that override one another hierarchically.

### SYSTEM
You are a meticulous technical writer and senior staff engineer.  
Your task is to create **AGENTS.md** for the repository whose contents are provided below.

### CONTEXT (replace the JSON blocks)
See the attached files.
@mguinada
mguinada / grpo_demo.py
Created January 30, 2025 23:29 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@mguinada
mguinada / calva.md
Created January 22, 2022 17:28 — forked from meta-forte/calva.md
Calva shortcuts for visual studio code

In VSCode, the default key binding for ctrl+, points to the settings menu. The number of times people access settings windows is far more less than the number of times s-expressions are executed. I modified calva key bindings to use ctrl+, (ctrl+oem_comma) instead of ctrl+alt+c. I also remapped the workbench settings keybinding to ctrl+, g so that it is still accessible. I left the Paredit settings unmodified. However, they are included in the below gist for reference. All the when clause of "when": "editorTextFocus && editorLangId == 'clojure'" so that their scope is limited to clojure only.

@mguinada
mguinada / hue.js
Created February 19, 2021 19:34 — forked from jamesbulpin/hue.js
Service to control Philips Hue lights in response to MQTT messages
require('es6-promise').polyfill();
var hue = require("node-hue-api"),
HueApi = hue.HueApi,
lightState = hue.lightState;
var mqtt = require('mqtt');
var schedule = require('node-schedule');
// Exit once an hour to force a re-read of the Hue lights list
var j = schedule.scheduleJob(new Date((new Date()).getTime()+3600000), function() {
console.log("[" + new Date() + "] " + "Exiting after pre-set delay.");
@mguinada
mguinada / gist:bd2df384b3bbf2a97a10f16a7a107cd3
Created October 31, 2020 20:46 — forked from rks/gist:2577339
Wrapping exceptions in Ruby
class CustomError < StandardError
def initialize(e = nil)
super e
set_backtrace e.backtrace if e
end
end
def run
r = Runner.new
r.fail
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que
- Model Student and model Teacher are both STI models with super class model User
- Model Story is a STI model with super class model Task
- includes() and joins(), both fails
Rails alias naming convention (includes() and joins())
- One model as parameter
- is base model (includes(:users))
@mguinada
mguinada / rails_webpacker_bootstrap_expose_jquery.md
Created May 10, 2019 10:26 — forked from andyyou/rails_webpacker_bootstrap_expose_jquery.md
Rails 5.2 with webpacker, bootstrap, stimulus starter

Rails 5.2 with webpacker, bootstrap, stimulus starter

This gist will collects all issues we solved with Rails 5.2 and Webpacker

Create Project

# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
@mguinada
mguinada / gist:0d2ab29084b61aada0b6e7f61dafc446
Created February 28, 2018 11:29 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@mguinada
mguinada / README.md
Created December 16, 2017 18:13 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@mguinada
mguinada / clj_spec_playground.clj
Created July 7, 2017 09:38 — forked from ghoseb/clj_spec_playground.clj
Examples of Clojure's new clojure.spec library
(ns clj-spec-playground
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.test.check.generators :as gen]))
;;; examples of clojure.spec being used like a gradual/dependently typed system.
(defn make-user
"Create a map of inputs after splitting name."
([name email]