This file contains hidden or 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 Category = require('../models').Category; | |
module.exports = { | |
create: function(req,res){ | |
Category.create({ | |
title: req.body.title, | |
color: req.body.color | |
}).then(result =>{ | |
res.json(result); | |
}).catch(err=>{ |
This file contains hidden or 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
Task.findById(req.params.id).then(task=>{ | |
task.description = req.body.description; | |
return task.save(); | |
}).then(()=>{ | |
if(!req.body.categories || req.body.categories.lenth == 0) return Promise.resolve(); | |
let categories = req.body.categories.split(","); | |
return task.addCategories(categories); | |
}).then(()=>{ | |
res.redirect(`/tasks/${task.id}`); |
This file contains hidden or 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 React from 'react'; | |
import Card from '@material-ui/core/Card'; | |
import CardContent from '@material-ui/core/CardContent'; | |
import CardMedia from '@material-ui/core/CardMedia'; | |
import Typography from '@material-ui/core/Typography'; | |
import { withStyles } from '@material-ui/core/styles'; | |
function AlbumCard(props){ | |
return( |
This file contains hidden or 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
// Instalar express | |
// npm install express | |
// https://expressjs.com/en/starter/hello-world.html | |
const express = require('express') | |
const app = express() | |
const port = 3000 | |
app.get('/', (req, res) =>{ |
This file contains hidden or 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 readline = require('readline'); | |
const interface = readline.createInterface({ input: process.stdin, output: process.stdout }); | |
const question = require('./question')(interface); | |
const operaciones = { | |
"1": { | |
text: "Suma de dos números", | |
method: (n1, n2) => n1 + n2 | |
}, | |
"2": { |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<link rel="manifest" href="/manifest.json"> | |
<title>Document</title> | |
<style> | |
body,html{margin:0;} |
This file contains hidden or 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
require 'digest/sha1' | |
require "google/cloud/firestore" | |
firebase_credentials = File.open('./firebase-key.json').read | |
firestore = Google::Cloud::Firestore.new(project_id: 'livemusiccodigofacilito', credentials: './firebase-key.json') | |
track_ref = firestore.doc "tracks/main" | |
music_data = "" | |
loop do | |
sleep(2) | |
file_content = File.read("./music.txt") | |
if file_content != music_data |
This file contains hidden or 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 CACHE_VERSION = 'v2'; | |
var CACHE_NAME = CACHE_VERSION + ':sw-cache-'; | |
var files_list = [ | |
// make sure serviceworker.js is not required by application.js | |
// if you want to reference application.js from here | |
'<%= asset_path "application.js" %>', | |
'<%= asset_path "application.css" %>', |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Mi primera página con React</title> | |
</head> | |
<body> |
This file contains hidden or 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 React from "react"; | |
import ReactDOM from "react-dom"; | |
const root = ReactDOM.createRoot(document.getElementById('root')); | |
root.render("Hello world"); |