Skip to content

Instantly share code, notes, and snippets.

Avatar

Juan Latorre juanlatorre

View GitHub Profile
View Chakra-UI x React-datepicker.md

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} />
View @chakra-ui+toast+1.0.0-rc.7.patch
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 Jul 29, 2020
Fix ADB version not matching
View adb.md
$ 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
JSON config for particles.json
View particles.json
{
"particles": {
"number": {
"value": 80,
"density": {
"enable": true,
"value_area": 800
}
},
"color": {
@juanlatorre
juanlatorre / README-Template.md
Created Feb 13, 2020 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.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

View NoIfSlider.js
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 Jun 21, 2019
wrapper to add .next() and .prev() and current() to array, without prototype
View iterifyArray.js
const iterifyArr = function(arr) {
var cur = 0;
arr.next = function() {
if (++cur <= this.length - 1) {
return this[cur];
} else {
cur = 0;
return this[cur];
}
};
@juanlatorre
juanlatorre / namecheap SSL.md
Created Jun 15, 2019 — forked from Shourai/namecheap SSL.md
Letsencrypt SSL certificate with namecheap hosting
View namecheap SSL.md

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.

View gist:40092fc6f777fa2f1877e2ff229f0db1
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@juanlatorre
juanlatorre / pyenv+virtualenv.md
Created Mar 11, 2019 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip
View pyenv+virtualenv.md

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv