Skip to content

Instantly share code, notes, and snippets.

View Yassir4's full-sized avatar
🎯
Focusing

Hartani Yassir Yassir4

🎯
Focusing
View GitHub Profile
@Yassir4
Yassir4 / index.js
Created September 15, 2020 08:01
Repositories
const handleOnEndReached = () => {
if (data.organization.repositories.pageInfo.hasNextPage)
return fetchMore({
variables: {
after: data.organization.repositories.pageInfo.endCursor,
first: 15,
},
updateQuery: onUpdate,
})
}
@Yassir4
Yassir4 / index.js
Last active September 15, 2020 08:00
Repositoires
import React from 'react'
import { Text, SafeAreaView, View, FlatList, ActivityIndicator } from 'react-native'
import { useQuery, gql } from '@apollo/client'
import RepositoryItem from './components/RepositoryItem'
import styles from './styles'
const REPOSITORIES_QUERY = gql`
query($first: Int!) {
organization(login: "facebook") {
repositories(first: $first) {
@Yassir4
Yassir4 / index.js
Created September 15, 2020 07:56
Repositories
const { data, error, loading, fetchMore } = useQuery(REPOSITORIES_QUERY, {
variables: { first: 15 },
})
@Yassir4
Yassir4 / resetXcode.sh
Created October 9, 2019 19:05 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
export const pushScreen = props => {
const { componentId } = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
},
});
};
export const openModal = () => {
@Yassir4
Yassir4 / index.js
Created August 13, 2019 11:36
export navigation functions Navigation/index.js
export const pushScreen = props => {
const { componentId } = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
},
});
};
export const openModal = () => {
@Yassir4
Yassir4 / styles.js
Created August 4, 2019 18:47
ModalScreen/styles.js
// ModalScreen/styles.js
import {StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'skyblue',
},
@Yassir4
Yassir4 / index.js
Created August 4, 2019 18:45
ModalScreen/index.js
// ModalScreen/index.js
import React, {Component} from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
class ModalScreen extends Component {
constructor(props) {
super(props);
Navigation.events().bindComponent(this);
@Yassir4
Yassir4 / index.js
Last active August 4, 2019 12:29
Home/index.js
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const pushScreen = props => {
const {componentId} = props;
Navigation.push(componentId, {
component: {
name: 'PushedScreen',
// PushedScreen/index.js
import React from 'react';
import {View, Text, TouchableOpacity} from 'react-native';
import {Navigation} from 'react-native-navigation';
import styles from './styles';
const goBack = ({componentId}) => Navigation.pop(componentId);
const PushedScreen = props => {
return (
<View style={styles.container}>