Skip to content

Instantly share code, notes, and snippets.

View koredefashokun's full-sized avatar

Oluwakorede Fashokun koredefashokun

View GitHub Profile
const obj1 = { a: { b: "c", x: "y" } }
const obj2 = { a: { b: "d", e: "f" } }
temp = Object.assign({}, obj1, obj2)
Object.keys(temp).forEach(key => {
temp[key] = (typeof temp[key] === 'object') ? Object.assign(temp[key], obj1[key], obj2[key]) : temp[key])
}
console.log(temp)

Keybase proof

I hereby claim:

  • I am koredefashokun on github.
  • I am koredefashokun (https://keybase.io/koredefashokun) on keybase.
  • I have a public key whose fingerprint is ECC6 A562 B6AB 6302 9010 8BA7 F3AF 4584 4529 1AF4

To claim this, I am signing this object:

@koredefashokun
koredefashokun / animation.md
Created October 30, 2019 23:31
closeAnimation

If you do this,

{children(closeAnimation)}

You can do this with the ModalPage:

<ModalPage>
  {(closeAnimation) => (
 
@koredefashokun
koredefashokun / tsconfig.json
Created January 27, 2019 21:10
My tslint config for RN
{
"compilerOptions": {
// Target latest version of ECMAScript.
"target": "esnext",
// Search under node_modules for non-relative imports.
"moduleResolution": "node",
// Process & infer types from .js files.
"allowJs": false,
// Don't emit; allow Babel to transform files.
"noEmit": true,
@koredefashokun
koredefashokun / .eslintrc
Created January 27, 2019 21:08
My eslint config for react native
module.exports = {
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react",
"react-native",
"prettier"
],
"settings": {
"import/resolver": {
@koredefashokun
koredefashokun / settings.json
Last active November 29, 2018 23:58
My VSCode Editor Customization
{
"editor.tabSize": 2,
"editor.fontFamily": "Dank Mono",
"editor.fontLigatures": true,
"workbench.colorTheme": "Atom One Dark",
"workbench.colorCustomizations": {
"statusBar.background": "#000000",
"panel.background": "#000000",
"sideBar.background": "#000000",
"activityBar.background": "#000000",
@koredefashokun
koredefashokun / LoginForm.js
Created November 8, 2018 01:51
Setup Input Validation
import * as React from 'react';
import { View, Text, TextInput, StyleSheet, Button } from 'react-native';
export default class App extends React.Component {
state = {
email: '',
password: '',
isEmailValid: true,
isPasswordValid: true
};
@koredefashokun
koredefashokun / Backend.js
Created June 9, 2018 04:27
Backend class
// import axios from 'axios'; // (This will probably be used later. Using good ol' Fetch API for now!)
import { AsyncStorage } from 'react-native';
// const API_URL = 'http://localhost:5500';
const API_URL = 'https://trail-api.herokuapp.com';
export default class Backend {
static logIn(username, password){
return fetch(`${API_URL}/users/login`, {
method: 'POST',
@koredefashokun
koredefashokun / app.js
Created April 2, 2018 19:26
Create app.js
require('dotenv').load();
const express = require('express');
const bodyParser = require('body-parser');
const expressValidator = require('express-validator');
const config = require('./config/database');
const mongoose = require('mongoose');
const port = process.env.PORT || 8550;
const app = express();