Skip to content

Instantly share code, notes, and snippets.

View matheuslemke's full-sized avatar
🎯
Focusing

Anderson Matheus Lemke matheuslemke

🎯
Focusing
View GitHub Profile
@matheuslemke
matheuslemke / react-best-practices.mdc
Created May 5, 2025 19:13
Cursor rules file for React development best practices
# React Development Rules
## State Management
1. **State Updates**
- When updating state based on previous state, always use the updater function:
```jsx
setCount(prevCount => prevCount + 1);
```
- For simple updates not depending on previous state, direct value is acceptable:
@matheuslemke
matheuslemke / curl-test.md
Created January 21, 2019 01:36 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@matheuslemke
matheuslemke / template.desktop
Created January 11, 2019 12:32
Template for unix desktop shortcuts
[Desktop Entry]
Version=1.0
Name=Name
GenericName=Web Browser
Exec=exec.sh
Terminal=false
Icon=path-icon.png
Type=Application
Categories=Network;WebBrowser;Favorites;
{
"workbench.startupEditor": "newUntitledFile",
"window.menuBarVisibility": "visible",
"workbench.statusBar.feedback.visible": false,
"window.titleBarStyle": "custom",
"window.newWindowDimensions": "maximized",
"files.autoGuessEncoding": true,
"explorer.openEditors.visible": 1,
"editor.minimap.enabled": false,
"editor.fontSize": 12,
@matheuslemke
matheuslemke / clean_code.md
Created October 3, 2018 18:11 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@matheuslemke
matheuslemke / add_intellij_launcer
Created July 16, 2018 14:59 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@matheuslemke
matheuslemke / update_firefox_developer_edition.sh
Created July 16, 2018 12:45 — forked from grenade/update_firefox_developer_edition.sh
this script is based on another for Sublime Text (http://www.simonewebdesign.it/install-sublime-text-3-on-linux/). It will handle updates (detects the latest developer or nightly edition) and locale (using your $LANG environment variable) (only tested on a 64 bit, fedora system, feedback welcome).
#!/bin/sh
# Firefox Developer Edition install
# No need to download this script, just run it on your terminal:
# $ curl -L git.io/firefoxdev | sh
# When you need to update Firefox Developer Edition, run this script again.
START_CMD="firefox-dev"
INSTALLATION_DIR="/opt/${START_CMD}"
@matheuslemke
matheuslemke / .curlrc
Created July 16, 2018 12:27 — forked from asmega/.curlrc
default proxy for curl in .curlrc
proxy=http://username:password@host:port
@matheuslemke
matheuslemke / list-constraints.sql
Created September 27, 2017 20:30 — forked from PickledDragon/list-constraints.sql
Postgres list all constraints
SELECT
tc.constraint_name, tc.table_name, kcu.column_name,
ccu.table_name AS foreign_table_name,
ccu.column_name AS foreign_column_name
FROM
information_schema.table_constraints AS tc
JOIN information_schema.key_column_usage AS kcu
ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage AS ccu
ON ccu.constraint_name = tc.constraint_name