Skip to content

Instantly share code, notes, and snippets.

View juanlatorre's full-sized avatar

Juan Latorre juanlatorre

View GitHub Profile
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

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} />
@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,
@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'