Skip to content

Instantly share code, notes, and snippets.

View renanmav's full-sized avatar
🕊️
grateful

Renan Mav renanmav

🕊️
grateful
View GitHub Profile
@hirbod
hirbod / LeanText.tsx
Last active January 30, 2025 06:23
React Native LeanView and LeanText component
import { type ComponentType, createElement, forwardRef } from 'react'
import type { TextProps } from 'react-native'
// uncomment for NativeWind support
//import { cssInterop } from 'nativewind'
const LeanText = forwardRef((props, ref) => {
return createElement('RCTText', { ...props, ref })
}) as ComponentType<TextProps>
@ospfranco
ospfranco / build-openssl.sh
Last active December 20, 2024 09:37
Cross-compile OpenSSL 3.X for Android
#!/bin/bash
# This script builds openSSL from source for the Android platform
# while patching some hand-written assembly that fails on Android
# It's useful when trying to use OpenSSL in Rust which tries to
# from the official sources and will therefore fail when launching
# your crate on Android
# Link to the main PR that fixes the sources:
@LauraBeatris
LauraBeatris / Spinner.js
Created April 16, 2020 21:59
Roullete Spinner made with React Hooks
const spinWheel = useCallback(() => {
// Receives the winner prop and search for his position in the spinner bets array
const order = [8, 1, 14, 2, 13, 3, 12, 4, 0, 11, 5, 10, 6, 9, 7];
const position = order.indexOf(winner);
// Determine position where to land
const rows = 12;
const card = 80 + 2 * 2;
let landingPosition = rows * 15 * card + position * card;
@solkaz
solkaz / detox-ts.md
Last active August 14, 2024 18:07
Writing Detox Tests with TypeScript

Usage

This guide assumes you've got a project using Detox with Jest, and you want to write your Detox tests in TypeScript.

  • Refer to this guide if you need to set up such a project.

1. Add TypeScript + ts-jest to package.json

We'll be using ts-jest to run Jest tests with TypeScript.

Github Two-Factor Authentication (2FA) for Brazil via SMS

The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55 will be the first on the list, already selected:


🇧🇷 [pt-BR]

Autenticação em dois fatores (2FA) do GitHub para o Brasil via SMS