Skip to content

Instantly share code, notes, and snippets.

View karlhorky's full-sized avatar

Karl Horky karlhorky

View GitHub Profile
@karlhorky
karlhorky / .cursorrules
Created September 6, 2024 09:00
.cursorrules for beginners from Moritz Kremb https://x.com/moritzkremb/status/1831790592138830211
## User Background
I am a programming beginner with limited knowledge of coding terminology and concepts. Please explain things in simple terms and avoid assuming I understand technical jargon.
## Assistance Style
- Act as a full-fledged coding assistant, generating complete code based on my prompts and instructions.
- I do not write any code myself; I rely entirely on your code generation.
- Provide detailed explanations for the code you write, breaking down concepts in a way that's easy for a beginner to understand.
## Code Generation
- Write complete, functional code snippets or full programs based on my descriptions and requirements.
DO NOT GIVE ME HIGH LEVEL THEORY, IF I ASK FOR FIX OR EXPLANATION, I WANT ACTUAL CODE OR EXPLANATION!!!!
DON'T WANT "Here's how you can blablabla"
- Be casual unless otherwise specified
- Be terse and concise
- Suggest solutions that I didn't think about - anticipate my needs
- Treat me as an expert
- Be accurate and thorough
- Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
- Value good arguments over authorities, the source is irrelevant
DO NOT GIVE ME HIGH LEVEL SHIT, IF I ASK FOR FIX OR EXPLANATION, I WANT ACTUAL CODE OR EXPLANATION!!! !
DON'T WANT "Here's how you can blablabla"
Be casual unless otherwise specified
Be terse
Suggest solutions that I didn't think about-anticipate my needs
- treat me as an expert
Be accurate and thorough
Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
@karlhorky
karlhorky / .cursorrules
Created August 27, 2024 12:04 — forked from Shpigford/.cursorrules
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@karlhorky
karlhorky / migrate-to-eslint-plugin-import-x.diff
Last active May 23, 2024 16:31
Migrate from eslint-plugin-import to eslint-plugin-import-x
// Migrate from eslint-plugin-import (no ESLint v9 support, multiple issues and missing features)
// to eslint-plugin-import-x
//
// - https://www.npmjs.com/package/eslint-plugin-import
// - https://www.npmjs.com/package/eslint-plugin-import-x
// First, install `eslint-plugin-import-x` (and for TypeScript support, `@typescript-eslint/parser`)
-import eslintImport from 'eslint-plugin-import';
+import eslintImportX from 'eslint-plugin-import-x';
@karlhorky
karlhorky / README.md
Created April 21, 2024 17:09 — forked from catalinmiron/README.md
Expo app.json Apple Privacy Manifest

About

The privacy details that you may need to add for Apple Privacy Manifest.

This config plugin it's already available from expo >=50.0.17 (Part of this PR by aleqsio)

Tip

Read more about Privacy Manifest File from Apple docs

@karlhorky
karlhorky / express-middleware-disable-gatsby-window-replacestate.ts
Created April 16, 2024 16:32
Express Middleware to Disable Gatsby's window.replaceState()
// Express middleware to disable Gatsby window.replaceState() to
// avoid changing new rewritten URLs back to original URLs
// https://github.com/gatsbyjs/gatsby/blob/c91ed287fd319a345c2f27877e20656826767e92/packages/gatsby/cache-dir/production-app.js#L159-L187
const appJsFilePath = existingGatsbyFiles.find((filePath) =>
/^\/app-[\da-f]+\.js$/.test(filePath),
)!;
const appJsContent = readFileSync(
join(websitePath, 'public', appJsFilePath),
'utf-8',
@karlhorky
karlhorky / Dockerfile
Created April 5, 2024 11:09 — forked from lithdew/Dockerfile
Dockerfile for deploying a Next.js standalone bundle on Fly.io with Bun.
# syntax = docker/dockerfile:1
# Adjust BUN_VERSION as desired
ARG BUN_VERSION=1.1.1
FROM oven/bun:${BUN_VERSION}-slim as base
LABEL fly_launch_runtime="Next.js"
# Next.js app lives here
WORKDIR /app
// guests+api.ts
import { ExpoRequest, ExpoResponse } from 'expo-router/server';
import { guestList, Guest } from './index+api.ts';
export const guestList: Guest[] = [];
export function GET(request: ExpoRequest): ExpoResponse {
return ExpoResponse.json(guestList);
}
@karlhorky
karlhorky / Tailwindcssunreset.scss
Created February 14, 2024 01:19 — forked from swyxio/Tailwindcssunreset.scss
Tailwind CSS Un-Reset - un-reset Tailwind's Preflight CSS Reset so that autogenerated HTML looks consistent with the rest of your Tailwind site. - https://www.swyx.io/writing/tailwind-unreset
.unreset {
a {
@apply text-blue-700 underline;
}
p {
@apply my-4;
}
blockquote,
figure {