Skip to content

Instantly share code, notes, and snippets.

View marceloag's full-sized avatar

Marcelo marceloag

View GitHub Profile
@marceloag
marceloag / Full Class
Created August 1, 2023 18:01
Full class css
.full {
width: 100% !important;
margin-left: auto;
margin-right: auto;
max-width: 100% !important;
}
@marceloag
marceloag / Validar Rut en Javascript
Created December 8, 2022 11:35
Funcion que valida el rut chileno en Javascript
const validateRut = (value) => {
const cleanValue = value.replace(/\.|-/g, '');
const isValid = /^\d{7,8}[0-9kK]$/.test(cleanValue);
if (isValid) {
const rutBody = cleanValue.slice(0, -1);
const rutVerifier = cleanValue.slice(-1).toUpperCase();
const product = rutBody
.split('')
.reverse()
@marceloag
marceloag / .eslintrc.json
Created December 10, 2021 13:28
Eslint Config
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"plugins:react-hooks/recommended",
"prettier"
@marceloag
marceloag / .prettierrc
Last active April 11, 2023 13:56
Prettier config
{
"singleQuote": true,
"trailingComma": "none",
"endOfLine": "auto",
"tabWidth": 2
}
import React, {Component, useState} from 'react';
import {StyleSheet, Text, View, FlatList, StatusBar, Image} from 'react-native';
import { withNavigation } from 'react-navigation';
import ModalSelector from 'react-native-modal-selector';
import { FontAwesome } from '@expo/vector-icons';
import RNDatePicker from '@react-native-community/datetimepicker';
import ListaItem from './Lista';
import Header from './Header';
import Footer from './Footer';
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
@marceloag
marceloag / Parcel Dev & Build
Created September 4, 2021 12:58
Parcel Commands for dev & build
"dev": "parcel src/index.html",
"build": "parcel build src/index.html"
@marceloag
marceloag / rn-component.js
Created May 24, 2019 23:20
dumb component
import React, { Component } from 'react';
class Home extends Component{
render() {
return this.props.children
}
}
export default Home;
@marceloag
marceloag / vue.html
Created February 17, 2019 14:54
Include Vue
<script src="https://unpkg.com/vue"> </script>
@marceloag
marceloag / coolql
Created January 22, 2019 19:02
Cool Ql
{
terrenos: site(url: "https://www.yapo.cl/magallanes_antartica/comprar?ca=14_s&cmn=290&ret=5&cg=1220&o=1") {
numberOfTitles: count(elem: "tr.listing_thumbs")
titles: selectAll(elem: "tr.listing_thumbs") {
select(elem :".title") {
titulo :text
url : href
}
precio : select(elem :".price") {
text