Skip to content

Instantly share code, notes, and snippets.

View genslein's full-sized avatar

Gabriel Enslein genslein

View GitHub Profile
@genslein
genslein / 00 - Cursor AI Prompting Rules.md
Created May 11, 2025 22:53 — forked from aashari/00 - Cursor AI Prompting Rules.md
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.

Cursor AI Prompting Framework Usage Guide

This guide explains how to use the structured prompting files (core.md, refresh.md, request.md) to optimize your interactions with Cursor AI, leading to more reliable, safe, and effective coding assistance.

Core Components

  1. core.md (Foundational Rules)
    • Purpose: Establishes the fundamental operating principles, safety protocols, tool usage guidelines, and validation requirements for Cursor AI. It ensures consistent and cautious behavior across all interactions.
    • Usage: This file's content should be persistently active during your Cursor sessions.
@genslein
genslein / advanced_search.markdown
Created February 28, 2024 17:41 — forked from dohsimpson/advanced_search.markdown
Advanced Search Tricks

Google

  • "cocotte bag": exact match
  • "* is thicker than water": * to replace a phrase inside exact match
  • jaguar -car: minus to filter out matches
  • site:time.com google: search on site, you don't need '.', e.g. 'site:gov'
  • define:bae: check definition, even for slang
  • $0..$50: numeric range (ignore $)
  • "inbound marketing" ~professional: synonyms
  • related:nationalgeographic.com: similar sites
@genslein
genslein / chat_server.rb
Created September 13, 2023 22:40 — forked from EvanBrightside/chat_server.rb
Chat Server Ruby
require 'socket'
def welcome(chatter)
chatter.print 'Welcome! Please enter your name: '
chatter.readline.chomp
end
def broadcast(message, chatters)
chatters.each do |chatter|
chatter.puts message
@genslein
genslein / chat.rb
Created September 13, 2023 22:38 — forked from akoskovacs/chat.rb
Ruby chat server
#!/usr/bin/env ruby
# Run with
# $ chmod +x chat.rb && ./chat.rb
# or
# $ ruby chat.rb
require 'socket'
require 'thread'
@genslein
genslein / fiberchat.rb
Created September 13, 2023 22:38 — forked from pfleidi/fiberchat.rb
A naive socket chat using select() and ruby fibers
require 'rubygems'
require 'socket'
include Socket::Constants
class ChatServer
def initialize
@reading = Array.new
@writing = Array.new
@clients = Hash.new
@genslein
genslein / goal_setting.md
Created January 24, 2023 15:56
Goals and review for X time period

Goals for this year:

  • List your major goals here! Sharing your goals with your manager & co-workers is really nice because it helps them see how they can support you in accomplishing those goals!

Goals for next year

  • If it's getting towards the end of the year, maybe start writing down what you think your goals for next year might be.

Projects

@genslein
genslein / CelsiusApiExample.js
Created April 7, 2022 20:51
testing celsius
const { Celsius, AUTH_METHODS, ENVIRONMENT } = require('celsius-sdk');
const FormData = require('form-data')
const axios = require("axios");
// const partnerKey = process.env.PARTNER_TOKEN // Should be kept secret
const partnerToken = "27ad54f93337ddf5ac9b3c3df7623d05";
const bodyFormData = new FormData({
"first_name": "Jane",
"last_name": "Doe",
"middle_name": "Middle",
@genslein
genslein / current_vacuums_in_progress.sql
Created February 1, 2022 16:28
Check postgres to see status of all vacuums running and their relations
SELECT
p.pid,
now() - a.xact_start AS duration,
coalesce(wait_event_type ||'.'|| wait_event, 'f') AS waiting,
CASE
WHEN a.query ~*'^autovacuum.*to prevent wraparound' THEN 'wraparound'
WHEN a.query ~*'^vacuum' THEN 'user'
ELSE 'regular'
END AS mode,
p.datname AS database,
@genslein
genslein / main.go
Created January 5, 2022 16:47 — forked from dopey/main.go
How to generate secure random strings in golang with crypto/rand.
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math/big"
)
@genslein
genslein / main.go
Created January 5, 2022 16:46 — forked from denisbrodbeck/main.go
How to generate secure random strings in golang with crypto/rand.
// License: MIT
package main
import (
"crypto/rand"
"fmt"
"math/big"
)
// GenerateRandomASCIIString returns a securely generated random ASCII string.