Skip to content

Instantly share code, notes, and snippets.

Committing from home

Ajay Kumar ajaykumar97

Committing from home
View GitHub Profile
ajaykumar97 / Mailer.js
Created July 29, 2019 17:59
This is an example function to pick document from the device, attach it with the email and open in the email application(gmail etc.)
View Mailer.js
Call pickDocAndSendToMail function on button click
//...other imports
import DocumentPicker from 'react-native-document-picker';
import Mailer from 'react-native-mail';
import RNFS from 'react-native-fs';
ajaykumar97 / SlideAnimation.js
Created September 20, 2019 04:50
Horizontal Search Header swipe example
View SlideAnimation.js
import React, { Component } from 'react';
import {
} from 'react-native';
ajaykumar97 / ReactHooks.js
Last active November 4, 2019 13:33
React-Hooks example
View ReactHooks.js
import React, { useState, useEffect } from 'react';
import { View, StyleSheet, Button, Text } from 'react-native';
// eslint-disable-next-line import/no-extraneous-dependencies
import uuidv4 from 'uuid/v4';
const ReactHooks = () => {
const [count, setCount] = useState(0);
const [users, setUsers] = useState([]);
ajaykumar97 / Logger
Last active December 6, 2019 16:42
Custom React-Native Logger
View Logger
Hi @everyone
I have created a LoggerJs to log outputs to make debugging easy. Please have a look at it and tell if you find it useful. If not, I would be glad to know your response and your suggestions.
It automatically disables the console.log if it is not the production environment.
It has different methods to log the out:
ajaykumar97 / DummyReadme.txt
Last active November 19, 2019 03:10
Dummy request readme
View DummyReadme.txt
baseUrl: http://0:0:0:0:8888/dummy1/v1/
imagesPath: http://0:0:0:0:8888/dummy1/v1/thumbnail/(image_name)/width/height
--> Send token in header in APIs like:
access_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjExLCJpYXQiOjE1MzExMjM3NDAsImV4cCI6MTUzMzcxNTc0MH0.ARupD0Y3bvzvCVDHeZtTFNU_6cFjNmwTMrqsIjD_C7M
=========================== Request Status Codes =======================
ajaykumar97 / Formik.js
Last active December 13, 2019 05:14
Formik + yup example
View Formik.js
import React from 'react';
import { Button, TextInput, View, Text, StyleSheet } from 'react-native';
import SplashScreen from 'react-native-splash-screen';
import { Formik } from 'formik';
import * as yup from 'yup';
class MyReactNativeForm extends React.Component {
componentDidMount() {
ajaykumar97 / GoogleSignin.txt
Last active January 1, 2020 11:33
Google Signin Configuration
View GoogleSignin.txt
1. To generate SHA-1 key for android on Linux:
For Debug mode:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For Release mode:
ajaykumar97 / GiftedChatIssue.js
Created December 19, 2019 09:17
Gifted Chat Small Jerk Issue
View GiftedChatIssue.js
import React from 'react';
import { GiftedChat } from 'react-native-gifted-chat';
export default class Example extends React.Component {
state = {
messages: [],
componentDidMount() {
ajaykumar97 / post-merge
Created October 17, 2020 14:21 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#!/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"

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