Skip to content

Instantly share code, notes, and snippets.

@ramarivera
ramarivera / DynamicColorModule2.kt
Created January 14, 2023 08:50
React Native Kotlin module for reading Android system colors
package com.roxasroottoolbox
import android.content.res.Resources
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import com.facebook.react.bridge.*
class DynamicColorModule2(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
override fun getName() = "DynamicColorModule"
@ramarivera
ramarivera / accuweather.html
Created August 9, 2018 18:56
Web scraping 02, realizando busquedas
<html>
<head>
<title>El tiempo de agosto para Concepción del Uruguay 2018 - Pronóstico de AccuWeather para Entre Ríos Argentina (ES)</title>
<link rel="canonical" href="https://www.accuweather.com/es/ar/concepcion-del-uruguay/3638/august-weather/3638">
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.accuweather.com/es/ar/concepcion-del-uruguay/3638/august-weather/3638">
<link rel="alternate" media="handheld" href="https://m.accuweather.com/es/ar/concepcion-del-uruguay/3638/august-weather/3638">
<meta name="viewport" content="width=988">
<link rel="stylesheet" href="https://vortex.accuweather.com/adc2010/stylesheets/slate.min-20180606-1001.css" type="text/css" media="all">
<link rel="shortcut icon" href="https://vortex.accuweather.com/adc2010/images/favicons/awx-2013-master.ico">
<link href="https://www.googletagservices.com" rel="preconnect" crossorigin="">
@ramarivera
ramarivera / apertura.py
Last active March 12, 2021 15:34
Web scraping 02, manejo de archivos
NOMBRE_DEL_ARCHIVO = 'prueba.txt'
with open(NOMBRE_DEL_ARCHIVO, mode='w+') as archivo:
archivo.write('Hola mundo!! \n')
@ramarivera
ramarivera / funciones.py
Created August 7, 2018 10:15
Web scraping 01, python 06
def sumar(a, b):
return a + b
def saludar(nombre):
print 'Hola ' + nombre + '!'
def cinco():
return 5
resultado = sumar(5, 6) # 11
@ramarivera
ramarivera / estructuras_datos.py
Created August 7, 2018 10:13
Web scraping 01, python 05
# Listas
letras = ['A', 'B', 'C', 'd', 'f']
# Tuplas
datos_persona = ('Ramiro', 25, False)
# Diccionarios
persona = {
'Nombre': 'Ramiro',
@ramarivera
ramarivera / ciclos.py
Created August 7, 2018 10:10
Web scraping 01, python 04
# Este ejemplo muestra en pantalla los numeros del 0 al 99
for i in range(0,100):
print(i)
# Este, por otra parte, imprime las letras A, B, C y D
for letra in ['A', 'B', 'C', 'D']:
print(letra)
# En este caso estamos imprimiendo de nuevo los numeros del 0 al 100
@ramarivera
ramarivera / operadores.py
Last active March 12, 2021 15:35
Web scraping 01, python 02
####### Operadores sobre Cadenas de texto
nombre = 'Ramiro '
saludo = 'Hola, '
# Concatenacion
resultado = saludo + nombre # 'Hola, Ramiro '
# Caracteres
inicial = nombre[0] # 'R'
@ramarivera
ramarivera / variables.py
Created August 7, 2018 09:46
Web scraping 01, python 01
nombre_perro = 'Max'
edad = 32
esta_nublado = True