Skip to content

Instantly share code, notes, and snippets.

View adhendo's full-sized avatar
🎯
Focusing

adhendo

🎯
Focusing
View GitHub Profile
@adhendo
adhendo / Podfile
Created June 29, 2021 16:38
Podfile for working with @homee/react-native-mapbox-navigation
plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!
install! 'cocoapods', :disable_input_output_paths => true
#use_frameworks!
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
@adhendo
adhendo / apollo.js
Created June 29, 2021 16:41
apollo-client-setup
import { ApolloClient, HttpLink, InMemoryCache } from "@apollo/client";
import { offsetLimitPagination } from "@apollo/client/utilities";
import { setContext } from "@apollo/link-context";
import { GRAPHQL_API_URL } from "react-native-dotenv";
import Firebase from "./firebase";
const asyncAuthLink = setContext(async () => {
return {
headers: {
Authorization: `Bearer ${await Firebase.auth().currentUser.getIdToken()}`,
@adhendo
adhendo / SearchScreen.js
Created June 29, 2021 16:49
React Native Search Screen Example
import { EvilIcons, Feather } from "@expo/vector-icons";
import AppLoading from "expo-app-loading";
import * as Expo from "expo-asset";
import PropTypes from "prop-types";
import React from "react";
import {
Image,
Keyboard,
SafeAreaView,
StatusBar,
@adhendo
adhendo / elasticIndexer.sh
Last active February 7, 2022 21:11
Command line script for bulk json file indexing to Elastic Search
cat example.json | jq -c -r '.[] | {"index": {"_index": "index_name", "_type": "_doc", "_id": .id}}, .' | curl -XPOST -H "Content-Type: application/json" https://elastic_search_url/index_name/_bulk --data-binary @-