Skip to content

Instantly share code, notes, and snippets.

View netojose's full-sized avatar
🎯
Focusing

José Neto netojose

🎯
Focusing
View GitHub Profile
@netojose
netojose / ComposeProviders.tsx
Last active September 13, 2022 01:27 — forked from sciotta/ComposeProviders.tsx
Compose React Providers to avoid too much chaining
import React, { ElementType, ReactNode, ReactElement } from 'react'
interface ComposeProvidersProps {
with: Array<{
component: ElementType,
props?: Record<string, unknown>,
}>,
children: ReactNode,
}
@netojose
netojose / styled.ts
Created August 21, 2022 20:10
Create styled react generator function
import { css, CssObject } from 'g-style'
import { createElement, ReactNode, HTMLProps } from 'react'
import filterInvalidDOMProps from 'filter-invalid-dom-props'
interface CProps extends HTMLProps<HTMLParamElement> {
children: ReactNode
}
export default function styled<T>(
tag: string,
@netojose
netojose / webpack.config.js
Created March 21, 2018 13:37
Webpack config to split css and js files by route and/or component (Webpack 2)
const path = require('path');
module.exports = {
entry: './src/index.jsx',
output: {
path: path.resolve('dist'),
filename: 'assets/js/[name].[hash:12].js',
publicPath: 'http://localhost:8080/'
},
resolve: {
@netojose
netojose / setup_genymotion_to_access_docker_container.md
Created August 23, 2017 11:40
Setup genymotion to access docker container.md
1.Open the commandline and run the following commands to edit the hosts file:
adb root
adb remount
adb pull /system/etc/hosts hosts
2.The hosts file should now be present in the folder where you excecuted the pull command. Edit the file with a text editor and add the sites you want to access. For example i added: