Skip to content

Instantly share code, notes, and snippets.

View gupta-ji6's full-sized avatar
👨‍💻
Decoding the code I wrote yesterday

ayush gupta gupta-ji6

👨‍💻
Decoding the code I wrote yesterday
View GitHub Profile
@gupta-ji6
gupta-ji6 / .zshrc
Created October 14, 2020 11:44
ZSH Config
View .zshrc
cat ascii
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
@gupta-ji6
gupta-ji6 / .eslintrc.json
Last active February 21, 2021 22:01
ESLint + Prettier Setup for React Project
View .eslintrc.json
{
"env": {
"browser": true,
"es2020": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
// "plugin:prettier/recommended",
@gupta-ji6
gupta-ji6 / .eslintrc.json
Last active April 20, 2021 14:46
ESLint Setup for React Native Projects
View .eslintrc.json
{
"env": {
"browser": true,
"es6": true,
"node": true,
"react-native/react-native": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
@gupta-ji6
gupta-ji6 / cloudSettings
Last active July 8, 2021 08:02
VS Code Settings - Work
View cloudSettings
{"lastUpload":"2021-07-08T08:02:04.361Z","extensionVersion":"v3.4.3"}
@gupta-ji6
gupta-ji6 / Share code with React & React Native.md
Created March 13, 2020 11:34
Share code with React & React Native
View Share code with React & React Native.md

Code Sharing between React & React Native

Approach 1: Shared Logic with Platform Specific UI Components

Source | Source Code

  • Same root component.
  • Write logic in a single file (with .js extension).
  • Reuse styles with styled-components
  • Redux code can easily be shared between platforms.
@gupta-ji6
gupta-ji6 / .hyper.js
Last active June 28, 2019 20:40
Hyper Configuration - gupta-ji6
View .hyper.js
// 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',
View copyWithoutReference.js
function copy(o) {
var output, v, key;
output = Array.isArray(o) ? [] : {};
for (key in o) {
v = o[key];
output[key] = (typeof v === "object") ? copy(v) : v;
}
return output;
}