Skip to content

Instantly share code, notes, and snippets.

View davidtorroija's full-sized avatar
🏠
Working from home

David davidtorroija

🏠
Working from home
View GitHub Profile
@davidtorroija
davidtorroija / jest.config.js
Created February 15, 2022 16:45
jest config
module.exports = {
moduleFileExtensions: [
"js",
"json",
// tell Jest to handle `*.vue` files
"vue",
],
transform: {
// process `*.vue` files with `vue-jest`
"^.+\\.vue$": "vue-jest",
@davidtorroija
davidtorroija / webpack-craco-config.js
Created July 14, 2022 15:10
craco config for wepback typescript create react app
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { addBeforeLoader, loaderByName } = require("@craco/craco");
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");
module.exports = {
devServer: (devServerConfig) => {
devServerConfig.writeToDisk = true;
return devServerConfig;
import React from 'react';
import Spinner from './Spinner';
const Card = ({ loadingData, showData, weather, forecast }) => {
const today = new Date();
const day = today.getDate();
const month = today.getMonth() + 1;
const year = today.getFullYear();
const date = `${day} / ${month} / ${year} `;
@davidtorroija
davidtorroija / gulpfile.js
Last active September 13, 2022 20:23
a task that I created in using gulp to easily change rem sizes based on 10px to 16px, this loop all the css and scss files and updates the measures using a regular expression, it works with calc, with 0.x .x etc
var replace = require('gulp-replace');
var gulp = require('gulp');
var js = {
src: [
'src/**/*.scss',
'src/**/*.css',
'src/**/*.tsx', //for the tsx files is in beta because it's including some strings like .remove or lorem ipsum, we need to tweak more the regexto exclude those
],
};