Skip to content

Instantly share code, notes, and snippets.

View emmacv's full-sized avatar
:shipit:
Everything is permitted

Emmanuel Canto Vazquez emmacv

:shipit:
Everything is permitted
View GitHub Profile
@emmacv
emmacv / ClearInputBuff.cpp
Created August 30, 2023 03:36 — forked from leimao/ClearInputBuff.cpp
Clearing input buffer in C++ completely
#include <iostream>
#include <limits>
using namespace std;
int main(){
char var[10];
bool valid = false;
while(!valid){
cout << "Enter a string 9 characters long: ";
@emmacv
emmacv / AdbCommands
Created July 15, 2023 18:44 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@emmacv
emmacv / useForm.ts
Created June 27, 2023 19:57
hook to handle form actions made in ts.
import { useCallback, useMemo, useReducer, useRef } from 'react';
import { TextInputProps } from 'react-native';
import useIsMounted from './useIsMounted';
type OnChange = TextInputProps['onChangeText'];
type FormValue = Record<string, any>;
type Errors<Value extends FormValue> = Partial<Value>;
type Settings<Value> = {
// hook
import React from 'react';
import { Dimensions, RefreshControl, ScrollView, View } from 'react-native';
import styled, { useTheme } from 'styled-components/native';
import i18n from '@helpers/i18n';
import { useLayout } from '@react-native-community/hooks';
import { Typography } from '@ui-kit/Typography';
@emmacv
emmacv / Transactions.tsx
Last active August 26, 2022 08:36
Gist to demonstrate the behaviour this component render.
// hook
import { useDebugValue, useEffect, useState } from 'react';
import { useUserListAccountMovementsInfinite } from '@api/account-movements/account-movements';
import { AccountMovements } from '@api/fRQTALNFTsAPI.schemas';
import i18n from '@helpers/i18n';
import SETTINGS from '../../shared/constants/transactionOptions';
type Transactions = Record<string, (AccountMovements | undefined)[]>;