Skip to content

Instantly share code, notes, and snippets.

@rawars
rawars / cursor-agent-system-prompt.txt
Created August 24, 2025 23:58 — forked from sshh12/cursor-agent-system-prompt.txt
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
@rawars
rawars / gist:240da8f9d7d479b63def3cddee6c95cb
Created October 12, 2023 15:21
Template balanceador de carga nginx
```
user www-data;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@rawars
rawars / Add product to cart wordpress
Created October 17, 2020 16:32
Add product to cart wordpress
```
add_action( 'template_redirect', 'bbloomer_add_product_to_cart_automatically' );
function bbloomer_add_product_to_cart_automatically() {
$product_id = $_GET["pt"]; // This variable contains the code of the product that you want to add to the cart.
WC()->cart->empty_cart(); // This step is required, if what you want is to allow only one product at a time
// if cart empty, add it to cart
if ( WC()->cart->get_cart_contents_count() == 0 ) { // This step is required, if what you want is to allow only one product at a time
WC()->cart->add_to_cart( $product_id ); // Add product
}
@rawars
rawars / Auto fill wordpress checkout form
Created October 17, 2020 16:24
Auto fill wordpress checkout form.
```
add_filter( 'woocommerce_checkout_get_value' , 'custom_checkout_get_value', 20, 2 );
function custom_checkout_get_value( $value, $imput ) {
// Billing first name
if(isset($_GET['FirstName']) && ! empty($_GET['FirstName']) && $imput == 'billing_first_name' )
$value = esc_attr( $_GET['FirstName'] );
// Billing last name
if(isset($_GET['LastName']) && ! empty($_GET['LastName']) && $imput == 'billing_last_name' )
$value = esc_attr( $_GET['LastName'] );
// Billing email
@rawars
rawars / emojis.json
Created July 8, 2020 17:17 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
function download(file) {
		return new Promise( async (resolve, reject) => {
			const fileId = file;
			const destPath = path.resolve(__dirname, '../temp/' + file.name + '.pdf');
			const dest = fs.createWriteStream(destPath);

			const res = await this.drive.files.export({
				auth: this.jwToken,
				fileId: fileId, // fileId,
@rawars
rawars / Tail of promises.md
Last active June 20, 2020 19:23
This code will help you when you have a list of asynchronous tasks to perform

Tail of promises

This code will help you when you have a list of asynchronous tasks to perform, for example a list of files that you have to upload to the server from nodejs.

function prueba() {
    return new Promise((resolve, reject) => {
        console.log("Promise start");
        resolve();
    })
}
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
import { MomentDateAdapter } from '@angular/material-moment-adapter';

export const MY_FORMATS = {
  parse: {
    dateInput: 'LL',
  },
  display: {
 dateInput: 'DD-MM-YYYY',
<?php
if(isset($_POST["to"]) && isset($_POST["subject"]) && isset($_POST["message"]) && isset($_POST["header"])){
   
    $from = "[email protected]";
        
    $to = $_POST["to"];
        
    $subject = $_POST["subject"];
 
@rawars
rawars / woocommerce-get-order-info.md
Created March 27, 2020 13:09
WooCommerce: Get Order Info (total, items, etc) from $order Object

1. You have access to $order

Hooks (do_action and apply_filters) use additional arguments which are passed on to the function. If they allow you to use the β€œ$order” object you’re in business. Here’s how to get all the order information:

// Get Order ID and Key
$order->get_id();
$order->get_order_key();
 
// Get Order Totals $0.00
$order->get_formatted_order_total();
$order->get_cart_tax();