Skip to content

Instantly share code, notes, and snippets.

@xthecapx
xthecapx / .gitignore
Last active March 13, 2021 21:38 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
numeros = [1, 2, 3]
print(numeros)
numeros.append(4)
print(numeros)
listaUno = ['a', 'b']
listaDos = ['x', 'y']
listas = [ listaUno, listaDos ]
const currency = number => {
return number.toLocaleString(
"en",
{
style: "currency",
currency: "USD",
minimumFractionDigits: 2
}
);
}
import React from 'react';
import {products} from './products';
const ProductDetails = ({ name, match }) => {
const { params: { productId }} = match;
const product = products[productId];
return (
<div className="product-deatils">
import React from 'react';
import {products} from './products';
const ProductDetails = ({ name, productId }) => {
const product = products[productId];
return (
<div className="product-deatils">
<h2>Product Details</h2>
import React from 'react';
const ProductDetails = () => {
return (
<div className="product-deatils">
<h2>Product Details works!</h2>
</div>
)
};
<ProductAlerts product={product} notify={onNotify} />
const onNotify = () => {
window.alert('You will be notified when the product goes on sale');
}
import React from 'react';
import {products} from './products';
const ProductAlerts = ({ product }) => {
let productAlerts;
if (product.price > 700) {
productAlerts = <p><button>Notify Me</button></p>;
}
<button onClick={share}>
 Share
</button>