Skip to content

Instantly share code, notes, and snippets.

View gourav-singhal's full-sized avatar
🎯
Focusing

Gourav Singhal gourav-singhal

🎯
Focusing
  • daffodilsw.com
  • Gurugram, India
  • 01:35 (UTC +05:30)
View GitHub Profile
@gourav-singhal
gourav-singhal / App.tsx
Created February 6, 2024 12:33 — forked from Glazzes/App.tsx
React Native pinch to zoom advanced
/**
* @author Santiago Zapata, Glazzes at Github <3
* @description This gist makes part of an article I'm writing about this topic (in spanish). This solution takes into account
* the linear algebra concepts and geometrical interpretation of the transform-origin property specification, this solution
* takes heavy inspiration from William's Candillon +3 year old video in this topic, however this solution brings it to the
* modern day along with a huge fix that prevents the origin from being displaced by an incorrect offset calculation after
* the first zoom interaction.
*
* This solution goes beyond a proof of concept as it does not have any drawbacks compared to the "only"
* solution seen in many youtube videos, therefore making this solution viable for real world
@gourav-singhal
gourav-singhal / Bitrise.io Documents.md
Created September 20, 2023 12:38 — forked from hungvu193/Bitrise.io Documents.md
How to setup Bitrise.io to run a react native project

Set up a React Native app on Bitrise

Getting Started

Automating React Native apps on Bitrise? Sure thing! Let's see how! 🤖

  1. Log in to Bitrise and click +Add new app on your Dashboard!
  2. Connect your repository from your connected source code provider or add it manually. Connect repo
  3. Setup repository access (See DevCenter for detailed explanation!) Setup repo
  4. Validation setup: choose a branch for our scanner, this will help automation. How about a cuppa coffee while we are scanning your app?
@gourav-singhal
gourav-singhal / App.tsx
Created March 19, 2023 04:49 — forked from alexdr00/App.tsx
CodePush: Silently update if it times out.
...
import useCodePushSetup from './hooks/useCodePushSetup';
function App() {
const { updateStatus, updateProgress } = useCodePushSetup();
return (
<View>
{(isLoading || updateStatus !== AppUpdateStatus.Ready) ? (
<View style={styles.loadingView}>
@gourav-singhal
gourav-singhal / AccessibilityWrapper.tsx
Created February 24, 2023 11:33 — forked from louy/AccessibilityWrapper.tsx
RN Accessibility Wrapper, a custom view that allows you to control the accessibility behaviour of a React Native component tree
/**
* @author Louay Alakkad (github.com/louy)
* @license MIT https://opensource.org/licenses/MIT
*/
import React from 'react'
import PropTypes from 'prop-types'
import {
NativeModules,
ViewProps,
ViewPropTypes,

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@gourav-singhal
gourav-singhal / MEMOIZE.md
Created June 29, 2022 07:55 — forked from mrousavy/MEMOIZE.md
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

import React, { useState } from 'react'
import { StyleSheet, Text, ScrollView, Button } from 'react-native'
import TextField from './components/TextField'
export default function App() {
const [value, setValue] = useState('')
const [error, setError] = useState<string | null>(null)
return (
<ScrollView contentContainerStyle={styles.content}>
@gourav-singhal
gourav-singhal / android-apk-user-certificates.md
Created September 28, 2020 11:48 — forked from luciopaiva/android-apk-user-certificates.md
Android APK HTTPS user certificates how-to

Android APK HTTPS user certificates how-to

Starting with Android Nougat, Google changed the way apps handle user certificates:

Apps that target API Level 24 and above no longer trust user or admin-added CAs for secure connections, by default.

This means that certificates issued by applications like [Charles][charles] or [mitmproxy][mitmproxy] are no longer accepted, so these proxies won't work for HTTPS traffic.

This tutorial explains what needs to be done to overcome that restriction and be able to sniff any Android app's HTTPS requests.