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
<?php | |
// @codingStandardsIgnoreFile | |
/** | |
* @file | |
* Drupal site-specific configuration file. | |
* | |
* IMPORTANT NOTE: | |
* This file may have been set to read-only by the Drupal installation program. |
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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 express = require('express'); | |
const next = require('next'); | |
const sm = require('sitemap'); | |
const axios = require('axios'); | |
const port = parseInt(process.env.PORT, 10) || 3000; | |
const dev = process.env.NODE_ENV !== 'production'; | |
const app = next({ dev }); | |
const handle = app.getRequestHandler(); |
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
# Conectarse a MongoDB | |
mongo <URI Atlas> | |
# Usar la base de datos creada de platzi | |
use platzi-db | |
# El campo _id si no es agregado por nosotros de forma explícita, MongoDB lo agrega por nosotros como un ObjectId | |
# el campo _id es obligatorio en todos los documentos |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
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
class PostDAO { | |
constructor () { | |
this.db = firebase.firestore() | |
const settings = { timestampsInSnapshots: true } | |
this.db.settings(settings) | |
} | |
add (post, id) { | |
this.db.collection('posts').doc(id).set({ | |
titulo: post.titulo, |
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
docker run hello-world | |
docker search Ubuntu | |
docker pull Ubuntu | |
docker images | |
docker run -it Ubuntu bash |
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
// importamos la libreria | |
const fs = require('fs'); | |
//puede llevar cualquier nombre, generalmente | |
// se sigue la convencion de usar el mismo nombre que la libreria | |
// fs es parte de la libreria estandard | |
/** | |
* @param {string} directorio de destino | |
* @param {string} texto a escribir dentro del archivo |
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
//File: lib/person.js | |
module "person" { | |
export function hello(nombre) { | |
return nombre; | |
} | |
} | |
//También se puede exportar así, según una aclaración de Sergio Daniel Xalambrí | |
// export function hello(nombre) {...}; |
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
var [a, b] = ["hola", "mundo"]; | |
console.log(a); // "hola" | |
console.log(b); // "mundo" | |
var obj = { nombre: "Carlos", apellido: "Azaustre" }; | |
var { nombre, apellido } = obj; | |
console.log(nombre); // "Carlos" | |
// Otro ejemplo | |
var foo = function() { |
NewerOlder