- Test-Driven Development (TDD) with pytest: Always write a failing test before writing implementation code (Red-Green-Refactor). Use
pytestandpytest-fixturesfor test setup, execution, and teardown. - KISS (Keep It Simple, Stupid): Favor the simplest solution that meets the requirements.
- DRY (Don't Repeat Yourself): Avoid code duplication. Extract reusable logic into functions or classes.
- Standard Libraries and Tools: Utilize standard Python libraries (like
datetimefor date/time,requestsfor HTTP requests, andlogging) and external libraries, includingBeautifulSoup4for HTML parsing, to avoid reinventing the wheel. Favor well-maintained and widely-used libraries. - YAGNI (You Ain't Gonna Need It): Don't implement features or functionality unless they are currently required.
- SOLID Principles & Extensibility: Adhere to SOLID principles, promoting maintainability, testability, and future extension. Consider potential future requi
My theory is that folks are hallucinating complex structure for these docs. If you read the Cursor forums, people are asking the Cursor LLM how to format them 🙃 Those shared above are the results of writing in the UI and what gets puts into version control.
My approach is that when I am annoyed by something I have to manually fix up, I go update the file.
Some of it is just impossible, like using the new Strong Params expects syntax given the training cutoffs. I’m not going to completely document the interface (cursor/rules can’t link to docs and can only link to a single file) . So I hint it, and it simply hallucinates the interface mostly correctly most of the time. Principle of Least Surprise in practice!
My .cursorrules were pretty inconsistent project to project, and I don’t believe that putting very generic things like “Use exceptions for exceptional cases, not for control flow” or “Use Active Record effectively” improves things.
| #!/usr/bin/env python3 | |
| """ | |
| You will need to install the pycryptodome package. | |
| You can do it with: | |
| pip3 install pycryptodome | |
| Note: To install pip3, run the following command | |
| sudo apt install python3-pip | |
| """ |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
| [nodejs] | |
| disabled = true | |
| [ruby] | |
| disabled = true | |
| [git_branch] | |
| symbol = '' | |
| format = "[$branch]($style) " | |
| style = 'dimmed yellow' | |
| [git_status] | |
| disabled = true |
| -server | |
| -Xms2048m | |
| -Xmx2048m | |
| -XX:NewSize=512m | |
| -XX:MaxNewSize=512m | |
| -XX:PermSize=512m | |
| -XX:MaxPermSize=512m | |
| -XX:+UseParNewGC | |
| -XX:ParallelGCThreads=4 | |
| -XX:MaxTenuringThreshold=1 |
When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.
Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.
So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).
| set ignorecase | |
| set smartcase | |
| set scrolloff=3 " 3 lines above/below cursor when scrolling | |
| " Emulated Plugins | |
| set surround | |
| " Copy to system clipboard as well | |
| set clipboard+=unnamed |
Last updated March 28, 2021
There are now two ways to approach this:
- Using gpg and generating keys
- Using Kryptonite by krypt.co
This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions