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 | |
trait ValidationInfo{ | |
function validateRFC($rfc){ | |
return strlen($rfc) == 13; | |
} | |
} | |
$anon_class = new class() { | |
use ValidationInfo; | |
}; |
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 | |
abstract class Employee { | |
public $employee_id; | |
public $name; | |
public $phone; | |
public $rfc; | |
abstract public function saludar(); |
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
// https://dev.to/api/articles?username=iamluisj | |
// AJAX => Asynchronous JavaScript and XML | |
// XMLHttpRequest | |
// fetch | |
async function cargarPublicaciones() { | |
let respuesta = await fetch('https://dev.to/api/articles?username=uriel_hedz'); | |
let jsonArticulos = await respuesta.json(); | |
return jsonArticulos; |
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
const root = ReactDOM.createRoot(document.getElementById('root')); | |
root.render("Hello world"); |
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 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 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 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 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 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 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) =>{ |
NewerOlder