Skip to content

Instantly share code, notes, and snippets.

View PabloPenia's full-sized avatar
🎯
Focusing

Pablo Peña PabloPenia

🎯
Focusing
View GitHub Profile
@PabloPenia
PabloPenia / .eslintrc.yml
Last active March 13, 2023 04:15
Vite configuration for React-Typescript with Linter, formatter and custom paths
---
env:
browser: true
es2021: true
extends:
- plugin:react/recommended
- standard-with-typescript
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:import/recommended

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode

Improved .sr-only

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@PabloPenia
PabloPenia / fetch_api.js
Last active September 6, 2022 13:38
Fetch api
// ? FETCH API (uso basico)
// recurso = url del fecth / opciones es un objeto
// https://developer.mozilla.org/en-US/docs/Web/API/fetch
// https://www.youtube.com/watch?v=Kpn2ajSa92c
// * Hago la solictud
// fetch('recurso', {opciones})
// * si la respuesta es exitosa la capturo en la variable response (o el nombre que sea)
// * y la convierto a json o guardo en db, o lo que necesite hacer.
// .then(response => response.json())
// * capturo el json en la variable 'json' ( o el nombre que le de) y la logueo o lo q necesite...
@PabloPenia
PabloPenia / population_by_country_2020.csv
Created May 8, 2022 00:57
Population By Country 2020
Country (or dependency) Population (2020) Yearly Change Net Change Density (P/Km²) Land Area (Km²) Migrants (net) Fert. Rate Med. Age Urban Pop % World Share
China 1440297825 0.39 % 5540090 153 9388211 -348399.0 1.7 38 61 % 18.47 %
India 1382345085 0.99 % 13586631 464 2973190 -532687.0 2.2 28 35 % 17.70 %
United States 331341050 0.59 % 1937734 36 9147420 954806.0 1.8 38 83 % 4.25 %
Indonesia 274021604 1.07 % 2898047 151 1811570 -98955.0 2.3 30 56 % 3.51 %
Pakistan 221612785 2.00 % 4327022 287 770880 -233379.0 3.6 23 35 % 2.83 %
Brazil 212821986 0.72 % 1509890 25 8358140 21200.0 1.7 33 88 % 2.73 %
Nigeria 206984347 2.58 % 5175990 226 910770 -60000.0 5.4 18 52 % 2.64 %
Bangladesh 164972348 1.01 % 1643222 1265 130170 -369501.0 2.1 28 39 % 2.11 %
Russia 145945524 0.04 % 62206 9 16376870 182456.0 1.8 40 74 % 1.87 %
@PabloPenia
PabloPenia / top10db.csv
Created May 7, 2022 16:36
Top 10 DB/IDE/Lang 2004-2021
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 33 columns, instead of 26. in line 4.
,Date,Apache Hive,CouchBase,CouchDB,DB2,dBase,DynamoDB,Elasticsearch,FileMaker,Firebase,Firebird,Hbase,Informix,Ingres,MariaDB,Memcached,Microsoft Access,MongoDB,MySQL,Neo4j,Netezza,Oracle,PostgreSQL,Redis,Riak,SAP HANA,Solr,Splunk,SQLite,SQL Server,Sybase,Teradata
0,July 2004,0.0005,0.0,0.0,0.0351,0.0049,0.0,0.0,0.0185,0.0,0.0175,0.0002,0.0099,0.0029,0.0,0.0002,0.2072,0.0,0.2187,0.0,0.0003,0.3116,0.027,0.0003,0.0002,0.0,0.0003,0.0,0.0028,0.1175,0.0225,0.002
1,August 2004,0.0004,0.0,0.0,0.0352,0.0047,0.0,0.0,0.0184,0.0,0.0155,0.0003,0.0098,0.0028,0.0,0.0002,0.2042,0.0,0.22,0.0,0.0003,0.3133,0.0267,0.0003,0.0002,0.0,0.0003,0.0,0.0031,0.1195,0.0226,0.0021
2,September 2004,0.0004,0.0,0.0,0.0356,0.0045,0.0,0.0,0.0184,0.0,0.0137,0.0002,0.0097,0.0029,0.0,0.0002,0.2019,0.0,0.2215,0.0,0.0003,0.3154,0.0264,0.0004,0.0001,0.0,0.0003,0.0,0.0032,0.1201,0.0226,0.0021
3,October 2004,0.0004,0.0,0.0,0.0359,0.0043,0.0,0.0,0.0178,0.0,0.0133,0.0001,0.0096,0.0028,0.0,0.0002,0.1992,0.0,0.2214,0.0,0.0003,0.3188,0.0261,0.0004,0.0002

You shouldn't use this code

Why? this is an old file that was used to test some things while working on freecodecamp curriculum.

If you need some of these implementations, rather check the finished work at: React Calculator repository.

More info there.

@PabloPenia
PabloPenia / quotes.json
Last active January 6, 2022 15:59
Data for FCC project: Random quote machine.
[
{
"quote": "None of us really changes over time. We only become more fully what we are.",
"author": "Anne Rice",
"avatar": "http://www.annerice.com/images/Gall10_10.jpg",
"book": "Interview with the vampire"
},
{
"quote": "There is one purpose to life and one only: to bear witness to and understand as much as possible of the complexity of the world- its beauty, its mysteries, its riddles.",
"author": "Anne Rice",
@PabloPenia
PabloPenia / gulpfile.basic.js
Created August 12, 2021 02:57
Simple gulp configuration with Pug, SCSS, ES6 and BrowserSync.
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var pug = require('gulp-pug');
var babel = require('gulp-babel');
var livereload = require('gulp-livereload');
var zip = require('gulp-zip');
var rev = require('gulp-rev');