Skip to content

Instantly share code, notes, and snippets.

View AndreiCalazans's full-sized avatar
🏠
Working from home

Andrei Xavier de Oliveira Calazans AndreiCalazans

🏠
Working from home
View GitHub Profile
@fakenickels
fakenickels / metro.config.js
Last active December 22, 2019 04:54 — forked from sibelius/metro.config.js
metro config to work with yarn workspaces
const path = require('path');
const getWorkspaces = require('get-yarn-workspaces');
const blacklist = require('metro-config/src/defaults/blacklist');
const workspaces = getWorkspaces(__dirname);
// Blacklists any react-native that doesn't come from packages/app
const blacklistRE = blacklist([ /(?<!packages\/app\/)node_modules\/react-native\/.*/g])
@tcodes0
tcodes0 / react-native-0.62-upgrade-tips.txt
Last active March 31, 2020 12:17
react-native 0.62 upgrade tips
BLOCKERS:
If you use react-native-fbads, it doesn't build on android 0.62.
Either wait fix or remove.
I've openned an issue already: https://github.com/callstack/react-native-fbads/issues/244
Some libs are also giving the Error "Super expression must either be null or a function"
You should open an issue and look for a PR that fixes it, or fix it yourself.
Example of a PR fixing this issue: https://github.com/expo/react-native-action-sheet/pull/162
To install a dep from a github PR, add to package.json:
@felippepuhle
felippepuhle / Player.tsx
Created November 13, 2020 13:22
ant media web player
import React, { useRef, useState, useCallback, useEffect, memo } from 'react'
import styled from 'styled-components'
import { MEDIA } from 'src/styles'
import {
AntMediaCommands,
AntMediaTakeConfigurationType,
AntMediaTakeConfigurationSignal,
AntMediaTakeCandidateSignal,
@jgcmarins
jgcmarins / RazzleStack.ts
Last active January 20, 2021 19:21
Deploy Razzle Apps to AWS Lambda using AWS CDK (https://aws.amazon.com/cdk/)
import * as CDK from '@aws-cdk/core';
import * as S3 from '@aws-cdk/aws-s3';
import * as S3Deployment from '@aws-cdk/aws-s3-deployment';
import * as Lambda from '@aws-cdk/aws-lambda';
import * as APIGateway from '@aws-cdk/aws-apigateway';
import * as SSM from '@aws-cdk/aws-ssm';
import * as SecretsManager from '@aws-cdk/aws-secretsmanager';
import { ConfigProps, getParam, ModeStack } from './helpers';
@jgcmarins
jgcmarins / react-native-upgrade.md
Last active February 17, 2021 14:19 — forked from julioxavierr/react-native-update.md
Steps to Upgrade a React Native App

React Native Upgrade Path

  1. Change React and React Native versions in package.json
  2. Run yarn install to upgrade dependencies
  3. Run yarn outdated or yarn upgrade-interactive to upgrade outdated libraries. Make sure that there's no breaking changes, check release notes (one by one).
  4. Compare your changes with the diff or use the upgrade-helper and update the native code.
  5. Open Xcode and link the binaries
  6. Run iOS
  7. Test iOS
  8. Run on Android
  9. Test Android
@sibelius
sibelius / Sample.tsx
Created February 27, 2019 15:47
useRelayPagination to be used with React Native Flatlist
const {
isFetchingEnd,
isFetchingTop,
onRefresh,
onEndReached,
} = useRelayPagination(relay, users);
const isRefreshing = isFetchingEnd || isFetchingTop;
<FlatList
@brianleroux
brianleroux / BeforeExitListener.js
Created September 12, 2019 22:04
Lambda NodeJS 10.x Default Runtime JavaScript
/** Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
"use strict";
/**
* The runtime has a single beforeExit function which is stored in the global
* object with a symbol key.
* The symbol is not exported.
* The process.beforeExit listener is setup in index.js along with all other
* top-level process event listeners.
*/
@jevakallio
jevakallio / synchronized-scrolling.js
Created December 9, 2016 23:54
React Native: Synchronized ScrollViews
import Exponent from 'exponent';
import React from 'react';
import { range } from 'lodash';
import {
StyleSheet,
Dimensions,
ScrollView,
Animated,
Text,
@stolinski
stolinski / providerCompose.js
Created April 23, 2019 17:40
ProviderComposer
function ProviderComposer({ contexts, children }) {
return contexts.reduceRight(
(kids, parent) =>
React.cloneElement(parent, {
children: kids,
}),
children
);
}