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
| incluir Bootstrap en React | |
| Puedes incluir el framework de bootstrap en el poderoso react siguiendo estos pasos: | |
| 1. instalar bootstrap | |
| Para instalar bootstrap, ve a la terminal, a la carpeta de tu proyecto y ejecuta el comando: | |
| npm install bootstrap | |
| 2. Importa las librerias de bootstrap | |
| En node_modules se agregarán los archivos de bootstrap. Ve al archivo index.js de tu proyecto y justo al principio pones el siguiente código para importar la librería |
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
| Para usar leaflet en proyectos de React | |
| ======================================= | |
| + npm install --save leaflet | |
| + npm install --save react-leaflet | |
| ```javascript | |
| import React from 'react'; | |
| import { Map, TileLayer } from 'react-leaflet'; |
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
| https://reacttraining.com/react-router/web/guides/quick-start | |
| npm install react-router-dom | |
| import React from "react"; | |
| import { | |
| BrowserRouter as Router, | |
| Switch, | |
| Route, | |
| Link | |
| } from "react-router-dom"; |
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 { Link } from 'react-router-dom'; | |
| import './styles/Badges.css'; | |
| import confLogo from '../images/badge-header.svg'; | |
| import BadgesList from '../components/BadgesList'; | |
| import api from '../api'; | |
| class Badges extends React.Component { | |
| state = { |
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
| // es6 ---- junio 2015 | |
| /** | |
| * -----------------------------------------------------------Default Params | |
| */ | |
| function newFunction(name, age, country) { | |
| var name = name || 'Oscar'; | |
| var age = age || 32; | |
| var country = country || 'MX'; | |
| console.log(name, age, country); | |
| } |
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
| // 1. Delete the Main.storyboard file from the project. Click Move to Trash. | |
| // 2. Remove Storyboard Name from File info.plist | |
| // 3. Go to Application Target -> Build Settings -> Find the line: UIKit Main Storyboard File Base Name and remove the name of the storyboard. | |
| // 4. In order to programmatically set the root controller of our application: | |
| // Go to SceneDelegate file and in the func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) method add the following code: | |
| import UIKit | |
| class SceneDelegate: UIResponder, UIWindowSceneDelegate { |
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 UIKit | |
| extension CGFloat { | |
| static func random() -> CGFloat { | |
| return CGFloat(arc4random()) / CGFloat(UInt32.max) | |
| } | |
| } | |
| extension UIColor { | |
| static func random() -> UIColor { |
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
| // # Serial queue | |
| // Creating a custom serial queue with a specific label | |
| let customQueue = DispatchQueue(label: "com.example.myqueue") | |
| // Adding a task to the custom queue | |
| customQueue.sync { | |
| // Perform some work here | |
| } | |
| // # Concurrent queue |
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
| // | |
| // ContentView.swift | |
| // cartographic-assistant | |
| // | |
| // Created by Harlock on 11/11/2023. | |
| // | |
| import SwiftUI | |
| struct ContentView: View { |
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 Foundation | |
| // let charactersURL = ApiService.character.url | |
| //output: url = https://rickandmortyapi.com/api/character | |
| // let url = ApiService.characterPage(19).url | |
| // output: url = https://rickandmortyapi.com/api/character/?page=19 | |
| enum ApiService { |
OlderNewer