Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
@kjk
kjk / cursor best practices.md
Created May 1, 2025 16:12
cursor best practices

Cursor best practices

I’m using cursor, so I’m wondering if I should go over best practices of using it first. This is to ensure as I work on my projects, I don’t get overwhelmed by complexity.

  • Before using cursor, ask Claude to create a clear and detailed plan in markdown (ask it to ask clarifying questions and then critique its own plan and then regenerate). Add it to instructions.md (so you can ask cursor to refer to it frequently)
    • I tell chatgpt what I want to create, then I ask it to provide instructions for another AI which will do the coding. Then I paste everything into the cursor composer agent.
    • Basically chatgpt adds another layer of planning which reduces the rate of encountering problems.
    • On one project cursor was running into some issues and couldn’t figure it out no matter what, I wasted hours stuck in a loop. Then I started from scratch, but this time I asked chatgpt 01 to write clear instructions for another coding AI. It worked like a charm.
  • **Use .cursor/rules (they
@kjk
kjk / pinboard.export.js
Created May 1, 2025 13:18
pinboard export
[{
"href": "http://blogs.rdoproject.org/7761/hands-on-linux-sandbox-with-namespaces-and-cgroups",
"description": "Hands on Linux sandbox with namespaces and cgroups",
"extended": "",
"meta": "e00cc75e6b9940c23bf4d1463f3ca953",
"hash": "dfcd7a85564dcfea336b8a3c1f091f09",
"time": "2016-06-05T01:07:31Z",
"shared": "yes",
"toread": "no",
"tags": "linux namespaces cgroups sandbox"
@kjk
kjk / toc.css
Last active December 16, 2024 20:38
Notion-like table of contents in plain JavaScript / CSS
/* http://localhost:9307/a-ytv9/implementing-notion-like-table-of-contents-in-javascript.html */
.toc-wrapper {
position: fixed;
top: 1rem;
right: 1rem;
z-index: 50;
max-height: calc(100vh - 2rem);
overflow-y: auto;
@kjk
kjk / deploy.go
Created September 27, 2023 15:45
example of deploying server binary to a server
package main
import (
"fmt"
"io/fs"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
@kjk
kjk / list-fonts.js
Created February 25, 2023 07:43
list fonts
const fontCheck = new Set([
// Windows 10
'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',
// macOS
'American Typewriter', 'Andale Mono', 'Arial', 'Aria
@kjk
kjk / v2.json
Created July 3, 2022 22:38
gdrive api (made with https://codeeval.dev)
{
"kind": "drive#fileList",
"etag": "\"dNzmxTQXf93-URXXV2e6HTjz4Uc\"",
"selfLink": "https://www.googleapis.com/drive/v2/files",
"nextPageToken": "~!!~AI9FV7TLkZbjkzrcrQWqhRUpOMAeA1WkjFDTn3zHXVv9Bigb-9iLCYw1O-ezzFljevtOfWIZHjy_rDWE0T7_taMq9ue72WfcfGr4r8VKaM-pqUFxxBP0o8rc8qCJPeQv_jatR0rlEjSnK8kw0WwyrsH5TniY5bdOrXh-_I1ikH26dtRCjTXQcQBAfaKhQapG63E5TNk4UdOcuvp3pGlIxKA7IP59ycgYEHFfGEN7cF3DUz9JnuCbjBjK3eS6XB1J8UqBVzgeL1kdRZo5j9lfMIC6sQHihLH9-haQR7pfqT6dbm-ffNtoCITzTuv4aCrP21Qbq5LqdzcZ",
"nextLink": "https://www.googleapis.com/drive/v2/files?pageToken=~!!~AI9FV7TLkZbjkzrcrQWqhRUpOMAeA1WkjFDTn3zHXVv9Bigb-9iLCYw1O-ezzFljevtOfWIZHjy_rDWE0T7_taMq9ue72WfcfGr4r8VKaM-pqUFxxBP0o8rc8qCJPeQv_jatR0rlEjSnK8kw0WwyrsH5TniY5bdOrXh-_I1ikH26dtRCjTXQcQBAfaKhQapG63E5TNk4UdOcuvp3pGlIxKA7IP59ycgYEHFfGEN7cF3DUz9JnuCbjBjK3eS6XB1J8UqBVzgeL1kdRZo5j9lfMIC6sQHihLH9-haQR7pfqT6dbm-ffNtoCITzTuv4aCrP21Qbq5LqdzcZ",
"incompleteSearch": false,
"items": [
{
"kind": "drive#file",
@kjk
kjk / TabsCtrl.cpp
Created May 23, 2022 00:56
sumatra tabs (made with https://codeeval.dev)
/* Copyright 2022 the SumatraPDF project authors (see AUTHORS file).
License: Simplified BSD (see COPYING.BSD) */
#include "utils/BaseUtil.h"
#include "utils/ScopedWin.h"
#include "utils/Dpi.h"
#include "utils/WinUtil.h"
#include "wingui/Layout.h"
#include "wingui/Window.h"
@kjk
kjk / main.go
Last active December 10, 2021 05:26
gomarkdown example for #216 (made with https://codeeval.dev)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/parser"
)
const md = `
- [level-1-b](#level-1)
@kjk
kjk / main.go
Created June 22, 2021 02:27
pretty print JSON (made with https://codeeval.dev)
package main
import (
"fmt"
"encoding/json"
"github.com/tidwall/pretty"
)
var prettyOpts = pretty.Options{
Width: 80,
#include <iostream> // std::cout
#include <atomic> // std::atomic, std::memory_order_relaxed
#include <thread> // std::thread
std::atomic_int foo (0);
void set_foo(int x) {
foo.store(x); // set value atomically
}