Skip to content

Instantly share code, notes, and snippets.

@muZk
muZk / _redirects
Created Dec 3, 2020
Netlify redirect for react app
View _redirects
# 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 Oct 5, 2020
Ejemplo backend express para MercadoPago
View simple-express.js
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 Oct 5, 2020
MercadoPago React
View Product.jsx
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 Mar 9, 2020
Ghost subscription tracker
View on-subscribe.js
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
}
});
});
View .eslintrc
{
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"jsx-a11y",
"import"
]
}
View gist:961af2e4c90fe48a399313b6858c21e2
# Events
before_save :set_number
def set_number
if user.present?
self.number = user.events.count
end
end
@muZk
muZk / README.md
Created Dec 12, 2017
How to use hover with react-jss
View README.md

How to use hover with react-jss

Let's say we have the following style:

const styles = (theme) => ({
  title: {
    color: theme.color,
  },
})
View .travis.yml
language: node_js
node_js:
- '8'
deploy:
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN
on:
tags: true
repo: muZk/pinericosas
View index.js
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’",
View README.md

Pinericosas

Just a "Hello World" library :)


Build Status

Installation