Skip to content

Instantly share code, notes, and snippets.

View ZainaliSyed's full-sized avatar
🎯
Focusing

Syed Zain Ali ZainaliSyed

🎯
Focusing
View GitHub Profile
@ZainaliSyed
ZainaliSyed / Addition.sol
Created August 29, 2018 17:46
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.21;
contract MyContract {
event Log(address addr);
constructor() public {
emit Log(this);
}
function add(uint256 a, uint256 b) public pure returns (uint256) {
return a + b;
}
}

GIT Commands

Clone

  • git clone [URL]

Commit

Pull

@ZainaliSyed
ZainaliSyed / IOS Certification Settings.md
Created May 22, 2018 10:31
IOS Certification Setting

Ios Certificate

General Tab

  • Remove tick from Automatic
  • Provissing Profile (Debug) Iphone Development
  • Provissing Profile (Release) Iphone Cubix Distribution

Build Setting Tab

Select none first

EsLint Rulels file (.eslintrc.json) will be create auto

paste rules .eslintrc.json by running ./node_modules/.bin/eslint --init

{ "extends": "airbnb",

"rules": { "react/prefer-stateless-function": 0, "import/no-unresolved": 0, "import/no-extraneous-dependencies": 0, "import/no-named-as-default": 0,

Formula for % Base calculation of width and height of a view in react native

import {Dimensions, PixelRatio} from 'react-native'; const widthPercentageToDP = widthPercent => { const screenWidth = Dimensions.get('window').width; // Convert string input to decimal number const elemWidth = parseFloat(widthPercent); return PixelRatio.roundToNearestPixel(screenWidth * elemWidth / 100); }; const heightPercentageToDP = heightPercent => { const screenHeight = Dimensions.get('window').height; // Convert string input to decimal number const elemHeight = parseFloat(heightPercent); return PixelRatio.roundToNearestPixel(screenHeight * elemHeight / 100); }; export { widthPercentageToDP, heightPercentageToDP };

@ZainaliSyed
ZainaliSyed / VSCodeSettings.md
Created February 15, 2018 07:42 — forked from shukerullah/VSCodeSettings.md
Visual Studio Code settings for React Native

React Native VSCode Settings

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, Mac OSX, and Windows.

This module will install visual studio code essential extensions and settings for react-native.

Install

@ZainaliSyed
ZainaliSyed / VisualStudioSetting.md
Last active January 16, 2020 08:22
`Visual Studio Code` settings for `React Native`

Visual Studio Code settings for React Native

Extensions

  • React Native Tools by Visual Studio Mobile Tools
  • Auto Close Tag by Jun Han
  • Auto Complete Tag by Jun Han
  • Auto Rename Tag by Jun Han
  • Babel ES6/ES7 by dzannotti
  • Code Spellcheker by Street Side Software
  • Color Highlight by Sergii Naumov
echo 256 | sudo tee -a /proc/sys/fs/inotify/max_user_instances
echo 32768 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
watchman shutdown-server
@ZainaliSyed
ZainaliSyed / Keys For Visual Studio Code.md
Last active November 16, 2021 08:01
`Shortcuts & Command` for `React-Native `

React-Native Command

Windows Commands

  • rm node_modules/
  • use ; for muti line commands
  • rm $TMPDIR/react-* ; rm ios/build ; rm node_modules ; yarn cache clean ; npm cache verify

React Native

  • react-native --help