Skip to content

Instantly share code, notes, and snippets.

View hayanisaid's full-sized avatar
🚀
I'm Full Stack JavaScript developer and Technical writer

Said Hayani hayanisaid

🚀
I'm Full Stack JavaScript developer and Technical writer
View GitHub Profile
@hayanisaid
hayanisaid / 1. main.css
Created November 15, 2017 22:30 — forked from EmranAhmed/1. main.css
CSS Responsive breakpoint, Media Query break point
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
@hayanisaid
hayanisaid / callapplybind.js
Created December 20, 2017 13:48 — forked from thamizhchelvan/callapplybind.js
A simple usecase to use call, apply and bind
'use strict';
var trip1 = {
destination: "Chennai",
id: 1
};
var trip2 = {
destination: "Ooty",
id: 2
@hayanisaid
hayanisaid / Instructions.md
Created August 7, 2018 10:26 — forked from glocore/Instructions.md
Setup React Native on Ubuntu 16.04/16.10

1. Install Node.js

  • Follow the steps given here to install Node.js and NPM.
  • Verify whether NPM is installed by typing npm -v in a terminal window.

2. Install React Native CLI

  • npm install -g react-native-cli

3. Setup Android Development Environment

  • Download and install Android Studio as explained here.
  • Run Android Studio and open the SDK Manager. Under the SDK Platforms tab, check Show Package Details, expand Android 6.0 (Marshmallow) and check the following:
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
export default class App extends Component<Props> {
render() {
return (
<View style={{flex:1,justifyContent:"center",backgroundColor:"#fff", alignItems:"center"}}>
<View style={{width:200,height:150,backgroundColor:"red",padding:10}}>
<Text style={{fontSize:20, color:"#666"}}>Styled with style props</Text>
</View>
</View>
import React, {Component} from 'react';
import { Text, View} from 'react-native';
export default class App extends Component<Props> {
render() {
return (
<View style={{flex:1,justifyContent:"center",backgroundColor:"#fff", alignItems:"stretch"}}>
<View style={{flex:1,backgroundColor:"red"}}>
<Text style={{fontSize:20, color:"#fff"}}>Item number 1</Text>
</View>
<View style={{flex:1,backgroundColor:"blue"}}>
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent:"center",
backgroundColor:"#fff",
alignItems:"stretch"
},
title: {
fontSize:20,
color:"#fff"
<View style={styles.container}>
<View style={styles.item1}>
<Text style={{fontSize:20, color:"#fff"}}>Item number 1</Text>
</View>
<View style={styles.item2}>
<Text style={{fontSize:20, color:"#fff"}}>Item number 1</Text>
</View>
<View style={styles.item3}>
<Text style={{fontSize:20, color:"#fff"}}>Item number 1</Text>
</View>
import React, {Component} from 'react';
import { StyleSheet,Text, View} from 'react-native';
import styled from 'styled-components'
const Container=styled.View`
flex:1;
padding:50px 0;
justify-content:center;
background-color:#f4f4f4;
align-items:center
`
import React, {Component} from 'react';
import { StyleSheet,Text, View} from 'react-native';
import styled from 'styled-components'
const Container=styled.View`
flex:1;
padding:50px 0;
justify-content:center;
background-color:#f4f4f4;
align-items:center
`
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, { Component } from "react";