Skip to content

Instantly share code, notes, and snippets.

View thenriquedb's full-sized avatar
⚛️

Thiago Henrique Domingues thenriquedb

⚛️
View GitHub Profile
@piouson
piouson / react-native-app-in-wsl2.md
Last active August 15, 2024 16:31 — forked from bergmannjg/rearct-native-app-in-wsl2.md
Building a react native app in WSL2

So, you have installed Android Studio, and is setting it up for react native, buuuut you're new to fish and it seems like it doesn't have a .bashrc or .zshrc equivalent.

worry not, just run the following, in order:

Set the ANDROID_HOME variable, here the U will make it persist through restarts, and the x will make it be exported:

set -Ux ANDROID_HOME $HOME/Android/Sdk
@fclesio
fclesio / linkedin-unfollow-everyone.js
Last active September 27, 2021 22:38 — forked from brunolemos/linkedin-unfollow-everyone.js
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@brunolemos
brunolemos / linkedin-unfollow-everyone.js
Last active February 3, 2024 05:47
Unfollow everyone on Linkedin
(() => {
let count = 0;
function getAllButtons() {
return document.querySelectorAll('button.is-following') || [];
}
async function unfollowAll() {
const buttons = getAllButtons();
@kripod
kripod / Box.tsx
Last active July 19, 2024 05:10
Superseded by https://www.kripod.dev/blog/behind-the-as-prop-polymorphism-done-well/ – Polymorphic `as` prop for React components with TypeScript
import React from 'react';
// Source: https://github.com/emotion-js/emotion/blob/master/packages/styled-base/types/helper.d.ts
type PropsOf<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
E extends keyof JSX.IntrinsicElements | React.JSXElementConstructor<any>
> = JSX.LibraryManagedAttributes<E, React.ComponentPropsWithRef<E>>;
export interface BoxOwnProps<E extends React.ElementType = React.ElementType> {
as?: E;
@luisfc
luisfc / config.fish
Last active April 1, 2024 14:03
ANDROID_HOME environment variable - fish shell linux
## Android
set --export ANDROID_HOME $HOME/Android/Sdk
set -gx PATH $ANDROID_HOME/emulator $PATH;
set -gx PATH $ANDROID_HOME/tools $PATH;
set -gx PATH $ANDROID_HOME/tools/bin $PATH;
set -gx PATH $ANDROID_HOME/platform-tools $PATH;
# When finished run: source ~/.config/fish/config.fish
@max10rogerio
max10rogerio / yup.locale.pt-br.js
Last active May 10, 2024 17:02
Translation of the main messages from the Yup library into the Pt-Br language.
/* eslint-disable */
// For more infos, see: https://github.com/jquense/yup/blob/master/src/locale.js
import { setLocale } from 'yup'
const translation = {
mixed: {
default: '${path} é inválido',
required: '${path} é um campo obrigatório',
oneOf: '${path} deve ser um dos seguintes valores: ${values}',
notOneOf: '${path} não pode ser um dos seguintes valores: ${values}',
@sdiama
sdiama / webview.js
Created May 29, 2019 17:47
React Native: Handle hardware back button @ webview
import React, { Component } from 'react';
import { WebView, BackHandler } from 'react-native';
export default class WebViewMoviezSpace extends Component {
constructor(props) {
super(props);
this.WEBVIEW_REF = React.createRef();
}
componentDidMount() {
@parties
parties / renameReactJsToJsx.sh
Last active August 6, 2024 22:14
rename all *.js files containing React markup to *.jsx
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \;