Skip to content

Instantly share code, notes, and snippets.

View Eric013's full-sized avatar

Sanchez Eric Eric013

View GitHub Profile
@claysauruswrecks
claysauruswrecks / requirements.txt
Last active April 7, 2024 16:32
Example using LlamaHub loaders to index Github repos into LlamaIndex and query GPTSimpleVectorIndex with GPT-4
# main
llama-index
langchain
@axeldelafosse
axeldelafosse / react-native-mmkv-plugin.js
Last active October 12, 2023 19:57
[DEPRECATED] React Native MMKV - Config plugin for Expo. You need to use "react-native-mmkv": "^1.6.2"
// DEPRECATED
const {
withDangerousMod,
WarningAggregator,
AndroidConfig,
withAppBuildGradle,
} = require("@expo/config-plugins");
const path = require("path");
const fs = require("fs");
@badsyntax
badsyntax / react-native-apple-m1.md
Last active March 11, 2024 18:25
Some tips to working with react-native 0.64 on an Apple M1 Silicon chip

My env:

  • cocoapods 1.10.1
  • xcode 12.4
  • macos big sur 11.2.3
  • react-native 0.64

iOS

The iOS simulator build won't "just work". If you get errors like ld: library not found for... or swift compiler errors, then you need to disable arm64 for the simulator build.

@kentcdodds
kentcdodds / README.md
Last active February 6, 2025 01:55
Function syntaxes supported by TypeScript

TypeScript Function Syntaxes

I'm trying to create examples of all the different ways to write functions and function type definitions in TypeScript.

One requirement is these examples must work with strict mode (noImplicitAny, etc) enabled.

If I'm missing anything, please add comments below with examples. I'll eventually put this into a blog post.

React.useEffect(() => {
setLoading(true);
const source = axios.CancelToken.source();
async function fetchData() {
try {
// Get all the Category content areas & topics
const dataAccess = new DataAccess.Client(props.user);
export const intersperse = <T>(arr: T[], separator: (n: number) => T): T[] =>
arr.flatMap(arr, (a, i) => i > 0 ? [separator(i-1), a] : [a]))
@slorber
slorber / react-navigation-tree.jsx
Last active August 13, 2022 19:17
react-navigation-tree.jsx
const App = createAppContainer(
createStack({
LoggedSwitch: createSwitch({
// When user is authenticated
LoggedIn: createStack({
// The logged in root is generally a tab or drawer navigator
LoggedInRoot: createTabsOrDrawer({
// Installation
// yarn add apollo-boost apollo-link-ws subscriptions-transport-ws react-apollo graphql
// npm install --save apollo-boost apollo-link-ws subscriptions-transport-ws react-apollo graphql
import React from 'react';
import { View, Text } from 'react-native';
import { ApolloClient } from 'apollo-client';
import { WebSocketLink } from 'apollo-link-ws';
import { InMemoryCache } from 'apollo-cache-inmemory';
@mooyoul
mooyoul / index.js
Created May 20, 2019 09:04
Fingerprint2 with Puppeteer
'use strict';
const debug = require('debug');
const puppeteer = require('puppeteer');
const log = debug('script');
log.enabled = true;
const ALLOWED_COMPONENT_KEYS = ['canvas', 'webgl', 'audio'].reduce((hash, v) => {
hash[v] = true;
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active October 6, 2025 09:37
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-