Skip to content

Instantly share code, notes, and snippets.

View juanlatorre's full-sized avatar

Juan Latorre juanlatorre

View GitHub Profile
@bbovenzi
bbovenzi / multi-select.ts
Last active May 27, 2021 20:15 — forked from csandman/README.md
A Chakra UI wrapper for react-select, made to be used as a multi-select which Chakra does not currently have (with Typescript support)
/* eslint-disable no-underscore-dangle */
import React from 'react';
import Select, { components as selectComponents, Props as SelectProps } from 'react-select';
import {
Flex,
Tag,
TagCloseButton,
TagLabel,
Divider,
CloseButton,
@baumandm
baumandm / Chakra-UI x React-datepicker.md
Last active March 4, 2023 20:56
Chakra-UI x React-datepicker

⚠️ I'd recommend using this fork by @igoro00 which has better theme support.


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

<DatePicker selectedDate={myDate} onChange={(d) => console.log(d)} />
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;
}
@gingerbeardman
gingerbeardman / 0x0.sh
Last active October 28, 2022 00:37
Simple cli tool to use https://0x0.st for ephemeral file uploads. Install: curl https://gist.githubusercontent.com/gingerbeardman/5398a5feee9fa1e157b827d245678ae3/raw/9ea5c714b41bdef77a8984bc91ff5d248c48d048/0x0.sh | sudo tee /usr/local/bin/0x0.sh && sudo chmod +x /usr/local/bin/0x0.sh
#!/bin/sh
URL="https://0x0.st"
if [ $# -eq 0 ]; then
echo "Usage: 0x0.st FILE\n"
exit 1
fi
FILE=$1
Today, I found how to fix my Cloud II horrible boosted treble and very little bass problem.
1. Download and install Equalizer APO from
https://sourceforge.net/p/equalizerapo/
2. During installation, select HyperX Cloud II from the playback devices available and hit OK.
3. Open Equalizer APO Configuration Editor from the start menu.
4. Inside 'config.txt' window, delete the three default presets. (click the red minuses)
@Shourai
Shourai / namecheap SSL.md
Created October 21, 2017 12:49
Letsencrypt SSL certificate with namecheap hosting

source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/

The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”

Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.

First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.

@exAspArk
exAspArk / curl.sh
Last active April 26, 2023 08:43
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'
@nopjia
nopjia / magikarpjump-expert3.sh
Last active October 14, 2018 12:42
ADB bash script for auto-clicking through Magikarp Jump Elite League 3
# Magikarp Jump
# Expert League 3 Automated Clicker
#
# Notes:
#
# All tap positions are hardcoded to my OnePlus3.
# Please re-adjust positions if phone resolution is different.
#
# Any league-triggered event will interrupt this script.
# It is best that level is maxed out before starting the league.
@schabluk
schabluk / ract-dropzone-image.js
Created February 10, 2017 11:55
React-Dropzone get image width, height and base64 data
onDrop = (acceptedFiles, rejectedFiles) => {
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,
@diegochavez
diegochavez / multiFilter.js
Last active January 16, 2022 12:38 — forked from jherax/filterArray.js
Multi filters an array of objects
/**
* Multi-filter an array of objects
* @param {Array} array : list of elements to apply a multiple criteria filter
* @param {Object} filters: Contains multiple criteria filters by the property names of the objects to filter
* @return {Array}
*/
function multiFilter(array, filters) {
let filterKeys = Object.keys(filters);
// filters all elements passing the criteria
return array.filter((item) => filterKeys.every((key) => (filters[key].indexOf(item[key]) !== -1)));