Skip to content

Instantly share code, notes, and snippets.

View Myrrel's full-sized avatar

Martín Urciuoli Myrrel

View GitHub Profile
@Myrrel
Myrrel / gist:d94340b407b6d3a043a0452dda8723ad
Created November 18, 2019 21:25
instalar bootstrap en react
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
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';
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";
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 = {
@Myrrel
Myrrel / ecmascript 6, 7, 8, y 9
Last active November 22, 2020 21:18
ecmascript
// 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);
}
@Myrrel
Myrrel / SceneDelegate.swift
Last active April 16, 2025 21:29
Removing Storyboard From App [Xcode 14, Swift 5]
// 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 {
@Myrrel
Myrrel / UIColor-random.swift
Last active November 13, 2023 16:57
UIColor random extension
import UIKit
extension CGFloat {
static func random() -> CGFloat {
return CGFloat(arc4random()) / CGFloat(UInt32.max)
}
}
extension UIColor {
static func random() -> UIColor {
@Myrrel
Myrrel / Grand_Central_Dispatch.swift
Created October 18, 2023 03:03
Grand Central Dispatch examples
// # 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
@Myrrel
Myrrel / GridLayout-Example.swift
Last active November 13, 2023 16:55
Uso de gridlayout
//
// ContentView.swift
// cartographic-assistant
//
// Created by Harlock on 11/11/2023.
//
import SwiftUI
struct ContentView: View {
@Myrrel
Myrrel / ApiService.swift
Last active March 10, 2024 21:56
Endpoints with enum
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 {