Skip to content

Instantly share code, notes, and snippets.

@muZk
muZk / _redirects
Created December 3, 2020 15:58
Netlify redirect for react app
# Redirects from what the browser requests to what we serve
# See: https://www.netlify.com/docs/redirects/
/* /index.html 200
@muZk
muZk / simple-express.js
Created October 5, 2020 01:28
Ejemplo backend express para MercadoPago
const mercadopago = require ('mercadopago');
const express = require('express');
const port = 3000;
mercadopago.configure({
access_token: 'PROD_ACCESS_TOKEN'
});
app.post('/api/orders', (req, res) => {
/* aquí crea tu orden en la DB para el usuario logeado */
@muZk
muZk / Product.jsx
Created October 5, 2020 01:16
MercadoPago React
import React, { useEffect, useState } from 'react';
import { useParams } from "react-router-dom";
const FORM_ID = 'payment-form';
export default function Product() {
const { id } = useParams(); // id de producto
const [preferenceId, setPreferenceId] = useState(null);
useEffect(() => {
@muZk
muZk / on-subscribe.js
Last active March 9, 2020 16:42
Ghost subscription tracker
if ("MutationObserver" in window) {
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
var form = mutation.target;
if (form.classList.contains('success') && mutation.oldValue != '') {
// TRACK HERE
}
});
});
{
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"jsx-a11y",
"import"
]
}
# Events
before_save :set_number
def set_number
if user.present?
self.number = user.events.count
end
end
@muZk
muZk / README.md
Created December 12, 2017 16:42
How to use hover with react-jss

How to use hover with react-jss

Let's say we have the following style:

const styles = (theme) => ({
  title: {
    color: theme.color,
  },
})
language: node_js
node_js:
- '8'
deploy:
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
tags: true
repo: muZk/pinericosas
const _ = require('lodash');
const quotes = [
"En esta isla vivió, durante cuatro largos años, Robinson Crusoe, cuya historia no solamente fascinó y emocionó al mundo entero sino que puso en el mapa del mundo a esta isla en la cual viven ochocientas chilenas y chilenos.",
"Y durante nuestro Gobierno, vamos a entregar cinco nuevos ‘tiatros’ regionales en Iquique, La Serena, ‘Rancuagua’, Concepción y Punta Arenas.",
"Si usted maneja, no conduce.",
"Nunca han mirado las estrellas, la galactea o el fondo del alma? Una cosa es mirar e intentar descubrir y otra cosa ver que es lo sensorial",
"Marepoto",
"Tusunami",
"Es la misma bandera con que hemos ‘cubrido’ tantas veces los féretros de nuestros ‘mártis’",

Pinericosas

Just a "Hello World" library :)


Build Status

Installation