This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createStore} from 'redux' | |
import rootReducer from './reducers' | |
import {Provider} from 'react-redux' | |
const store = createStore( | |
rootReducer, | |
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() | |
) | |
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createStore} from 'redux' | |
import rootReducer from './reducers' | |
import {Provider} from 'react-redux' | |
const store = createStore( | |
rootReducer, | |
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() | |
) | |
ReactDOM.render(<Provider store={store}><App /></Provider>, document.getElementById('root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install curl https://pyenv.run | bash | |
add | |
export PATH="/Users/Admin/.pyenv/bin:$PATH" | |
eval "$(pyenv init -)" | |
eval "$(pyenv virtualenv-init -)" | |
sudo micro ~/.zshrc | |
source ~/.zshrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
si se desea activar de manera segura el debugger de node se debe seguir los siguientes pasos | |
1. corra el script con el argumento inspect-brk | |
``` | |
pm2 start ./server/server.js --node-args="--inspect-brk" --name api-test | |
``` | |
luego, *NO* abra puertos, esto es inseguro y cualquiera con acceso a su ip y puerto tendría acceso al código, para conectar la máquina local lo mejor es usar un ssh tunneling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { forwardRef, useRef, useImperativeHandle } = React; | |
// We need to wrap component in `forwardRef` in order to gain | |
// access to the ref object that is assigned using the `ref` prop. | |
// This ref is passed as the second parameter to the function component. | |
const Child = forwardRef((props, ref) => { | |
// The component instance will be extended | |
// with whatever you return from the callback passed | |
// as the second argument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from "react"; | |
const useOutsideClick = (ref, callback) => { | |
const handleClick = e => { | |
if (ref.current && !ref.current.contains(e.target)) { | |
callback(); | |
} | |
}; | |
useEffect(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
LA IDEA ES LA SIGUIENTE: | |
AL DARLE CLICK A UN MODAL SE DEBEN RENDERIZAR DOS RUTAS, LA RUTA DE LA PÁGINA DE ABAJO Y LA RUTA DEL MODAL | |
PARA SABER LA RUTA DE ABAJO SE CREA UN ESTADO backgroundPage QUE ES DE LA FORMA {pathname:<ruta>} | |
CUANDO LA PERSONA DA CLICK PARA ABRIR UN MODAL (LINEA 123,128) SE SETEA ESE ESTADO CON EL PATH ACTUAL...ESO LO HACE LinkToModal (114) QUE SETEA EL BACKGROUND | |
LLAMANDO A LA ACCIÓN setModalBackgroundPageAction (57) TIENES UN EXTRACTO DEL ESTADO EN LA LINEA 204 | |
ES DECIR, SI backgroundPage ESTÁ SETEADO SE MUESTRA EL MODAL Y EL SWITCH RENDERIZA ESA RUTA (82,177) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Document Ready check | |
This snippet will covers all the browser to check if the DOM is ready. | |
document.addEventListener("DOMContentLoaded", function() { | |
console.log('Your document is ready!'); | |
}); | |
Document Ready check for IE8 | |
Offcourse there is IE8, who wants a different way. | |
document.attachEvent("onreadystatechange", function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.your_nav_element:not(:last-child) { | |
-webkit-box-shadow: 10px 0px 0px -9px white; | |
-moz-box-shadow: 10px 0px 0px -9px white; | |
box-shadow: 10px 0px 0px -9px white; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# low disk space | |
# checking the latest collected values | |
# raise an alarm if the disk is low on | |
# available disk space | |
template: disk_space_usage | |
on: disk.space | |
families: * |