Skip to content

Instantly share code, notes, and snippets.

View droidMakk's full-sized avatar
🏠
Working from home, Yet globally active 😉

Afroze droidMakk

🏠
Working from home, Yet globally active 😉
View GitHub Profile
@droidMakk
droidMakk / CardCascade.js
Created June 26, 2020 06:37
ANIMATION TESTING
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/
import React from 'react';
import {View, Text, StyleSheet, Dimensions, StatusBar} from 'react-native';
@droidMakk
droidMakk / NetworkContext.jsx
Created September 14, 2019 13:00
So this gist contains a hook to make network request and recieves the config from a NetworkConfig context. Make sure to wrap your app around the context when you start using this.
import React from 'react';
// Either use a config file or env file
import { API_URL, HOME_PAGE_URL } from '../config';
const initialCtx = {
NetworkCtx: {
apiUrl: API_URL, token: null, homePage: HOME_PAGE_URL
},
setNetworkCtx: () => null
}
import { _AccountServiceWrapper, AccountServiceWrapper } from './accountService';
describe('Get Account Information', () => {
test('should account type be lease', () => {
const spy = jest.spyOn(_AccountServiceWrapper, 'getAccountByAccountNumberAndCountry');
let accountData = _AccountServiceWrapper.getAccountByAccountNumberAndCountry();
@droidMakk
droidMakk / validator.js
Created April 18, 2019 00:16
Simple Validator
async function validator(requestObject, validatingObj){
let paramsError = {
missingParams: [],
invalidParams: [],
message: ''
}
function constructMessage(_paramsError){
let missingParamsMsg = `Missing the following parameters ${_paramsError.missingParams.join()}`;
@droidMakk
droidMakk / EnumsAndTypes.ts
Created April 4, 2019 01:40
Using Types and Enums in Typescript
export enum ProperType {
Lease, Rent, Own
}
export interface PayOffQuote {
quoteDate: Date,
goThroughDate: Date,
ResidualValue: BigInteger,
propertyType: ProperType,
PayOFfTax: BigInteger,
@droidMakk
droidMakk / handleNetworkCall.js
Created March 31, 2019 12:12
Async await, Promises and CallBack
var fetch = require('node-fetch');
const apiUrl = 'https://jsonplaceholder.typicode.com/users';
//Async await method
var fetchUsers = async () => {
var response = await fetch(apiUrl);
var data = response.json();
return data;
}
@droidMakk
droidMakk / package.json
Last active March 26, 2019 19:40
Babel Typescript Express
{
"scripts": {
"build": "babel ./src --out-dir build --extensions \".ts\"",
"serve": "nodemon build/index.js",
"type-check": "tsc --noEmit",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"express": "^4.16.4"
},
@droidMakk
droidMakk / ReadME.md
Last active March 26, 2019 10:30
Snack Bytes session tools

Snack Bytes

  1. Boost note - Link
  2. Codeceptjs - Docs
  3. Formik 😊*Forms - Docs
  4. Yup Schema based validator - Docs
  5. DevDocs Documentation in one place - link
  6. Reactotron Monitor App State - link
@droidMakk
droidMakk / .hyper.js
Created July 22, 2018 03:36
Hyper plugins customization config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@droidMakk
droidMakk / .eslintrc.json
Last active July 15, 2018 03:20
Custom set of Configurations for Project
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parser": "babel-eslint",
"extends": ["standard","eslint:recommended", "plugin:react/all"],
"parserOptions": {