Skip to content

Instantly share code, notes, and snippets.

View AshRhazaly's full-sized avatar

Ash Rhazaly AshRhazaly

  • Singapore
View GitHub Profile
@AshRhazaly
AshRhazaly / Aws.md
Last active March 25, 2018 15:24
AWS Notes

IAM - Identity Access Management

  1. Policies
  • IAM policies are attached to users, roles or groups which grant access to various AWS services or full access to AWS(god-mode)
  1. Users
  • Users can attached to groups and policies can be attached to groups so each user may have their own unique policies besides their group policies.
  1. Roles
  • Roles are created to be attached to EC2 instances, for example, I can create an S3-Admin-Access role which I will attach to my EC2 isntance, so it can read and write to my S3 bucket
@AshRhazaly
AshRhazaly / reactnavig.md
Last active October 20, 2017 15:41
ReactNative Navigation

React Native Navigation

React Native Router Flux

Getting Started

  • npm install --save react-native-router-flux
  • Determine the flow of your app to determine the scenes(screens/pages)
<Scene key="login" component={LoginForm} title="Login" initial />
@AshRhazaly
AshRhazaly / reactredux.md
Last active October 9, 2020 16:33
React Native + Redux Notes

React + Redux

Installing redux

  • npm install --save redux react-redux

Redux BoilerPlate

  1. Store will hold the entire app's state
  2. Provider will translate the state in the store to be consumed by the app
  3. Providers can only have 1 child element at a time.
import React, { Component } from 'react';
@AshRhazaly
AshRhazaly / reactnative.md
Last active May 29, 2018 15:29
React Native Notes

Initializing React Native

Enter these commands in the terminal

  1. npm install react-native
  2. npm install react-native-cli
  3. brew install watchman
  4. Optional https://atom.io/packages/react-native-snippets

To initialize your react native project

  • react-native init AppName

session management

  1. tmux ls (or tmux list-sessions)
  2. tmux new -s session-name
  3. Ctrl-b d Detach from session
  4. tmux attach -t [session name]
  5. tmux kill-session -t session-name

Window Management

  1. Ctrl-b c Create new window
  2. Ctrl-b d Detach current client
// Basic movement
HJKL - LEFT, DOWN, UP, RIGHT
// Centering Screen
zz - Moves the cursor to the center
zt - Moves the cursor to the top
zb - Moves the cursor to the bottom
// Entering Insert Mode
Press I
Prototype mode is where interactivity is added
Design mode is self explanatory.
Record button in preview mode captures the user's actions and reveals the pain points.
// Short cuts
Perfect Circle
- perfect circle using the Ellipse Tool, click and drag with your cursor while pressing Shift on your keyboard
@AshRhazaly
AshRhazaly / gist:287df37884b2cdcd7702a146ff5cf6ee
Last active May 2, 2017 08:29
react fetching data using AXIOS
Documentation
### https://github.com/mzabriskie/axios
// Installing axios & using it
1. Type "npm install --save axios" in terminal
2. import axios from 'axios';
// A GET response in axios
// Adding the fetch method
e.g
componentDidMount() {
fetch()
// in the fetch method include the api url and api token ( like in postman )
// it is possible to chain methods after the request is successful
}
// Installing react-router
1. npm install --save-dev react-router-dom
2. Import react router libs by adding this code at the top.
import {
HashRouter,
Route,
Link
} from 'react-router-dom';