Skip to content

Instantly share code, notes, and snippets.

View juanlatorre's full-sized avatar

Juan Latorre juanlatorre

View GitHub Profile
@juanlatorre
juanlatorre / audit-your-codebase.md
Created August 16, 2026 18:52 — forked from aarondfrancis/audit-your-codebase.md
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

@juanlatorre
juanlatorre / curl.sh
Created May 5, 2021 00:09 — forked from exAspArk/curl.sh
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
@juanlatorre
juanlatorre / ract-dropzone-image.js
Last active April 30, 2021 21:07 — forked from schabluk/ract-dropzone-image.js
React-Dropzone get image width, height and base64 data
const onDrop = useCallback((acceptedFiles) => {
const file = acceptedFiles.find(f => f)
const i = new Image()
i.onload = () => {
let reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
console.log({
src: file.preview,

Tiny wrapper component for React-Datepicker to stylistically fit with Chakra-UI 1.x.

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />

Clearable version:

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} isClearable={true} />
diff --git a/node_modules/@chakra-ui/toast/dist/esm/toast-manager.js b/node_modules/@chakra-ui/toast/dist/esm/toast-manager.js
index f64ed90..af3e367 100644
--- a/node_modules/@chakra-ui/toast/dist/esm/toast-manager.js
+++ b/node_modules/@chakra-ui/toast/dist/esm/toast-manager.js
@@ -119,9 +119,18 @@ export class ToastManager extends React.Component {
var position = getToastPosition(prevState, id);
if (!position) return prevState;
return _extends({}, prevState, {
- [position]: prevState[position].map(toast => _extends({}, toast, {
- requestClose: toast.id === id ? true : toast.requestClose
@juanlatorre
juanlatorre / adb.md
Last active July 29, 2020 18:31
Fix ADB version not matching
$ adb kill-server
$ sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
$ sudo chmod +x /usr/bin/adb
$ adb start-server
@juanlatorre
juanlatorre / particles.json
Created May 14, 2020 04:40
JSON config for particles.json
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
@juanlatorre
juanlatorre / README-Template.md
Created February 13, 2020 19:21 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

const imageData = [ 'image1.png', 'img2.png', 'img3.png' ];
const currentImage = 0;
const handleImageChange = (direction) => {
if (direction == 'forward')
currentImage = (currentImage + 1) % imageData.length;
else
currentImage = (currentImage - 1 + imageData.length) % imageData.length;
}
@juanlatorre
juanlatorre / iterifyArray.js
Last active June 21, 2019 16:53
wrapper to add .next() and .prev() and current() to array, without prototype
const iterifyArr = function(arr) {
var cur = 0;
arr.next = function() {
if (++cur <= this.length - 1) {
return this[cur];
} else {
cur = 0;
return this[cur];
}
};