Skip to content

Instantly share code, notes, and snippets.

View nandorojo's full-sized avatar

Fernando Rojo nandorojo

View GitHub Profile
#To view the page go here: http://langadv.myshopify.com/pages/spanish. In the top right corner click enter password which is arcoiris11
<h3>Arcoiris Level 1</h3>
<a name="arcoiris1"></a>
<div data-embed_type="product" data-shop="langadv.myshopify.com" data-product_name="Arcoiris Level 1 Spanish Workbook &amp; Audio CD" data-product_handle="arcoiris-level-1-spanish-workbook-cd" data-has_image="true" data-display_size="compact" data-redirect_to="product" data-buy_button_text="Arcoiris 1" data-button_background_color="7db461" data-button_text_color="ffffff" data-variant_id="4094347589"></div>
<a href="https://langadv.myshopify.com/products/arcoiris-level-1-spanish-workbook-cd?channel=buy_button&amp;referer=http%3A%2F%2Flangadv.myshopify.com%2Fpages%2Fspanish&amp;variant=4094347589"><script type="text/javascript">// <![CDATA[
document.getElementById('ShopifyEmbedScript') || document.write('<script type="text/javascript" src="https://widgets.shopifyapps.com/assets/widgets/embed/client.js" id="ShopifyEmbedScrip
@nandorojo
nandorojo / react-native-file-upload.js
Created May 2, 2019 23:30
Upload a file to your server using react native / expo.
/*
IF YOU WANT TO UPLOAD ONE FILE, USE THE CODE BELOW.
SEE THE BOTTOM OF THE GIST TO SEE HOW TO UPLOAD MULTIPLE FILES.
HERE'S AN EXAMPLE SOMEONE MADE USING CLOUDINARY: https://gist.github.com/jamielob/5c1a5dc84e50e4507b71299d993dffec
*/
@nandorojo
nandorojo / react-native-file-upload.js
Created July 13, 2019 22:42
React Native Hook for uploading file (Cloudinary in this case)
import { useState } from 'react';
import CryptoJS from 'crypto-js';
// upload a file to cloudinary using React Hooks
// see below for what hooks are
// https://reactjs.org/docs/hooks-intro.html
// make sure you fill these out:
const API_KEY = '';
const SECRET = '';
@nandorojo
nandorojo / segment-webflow.js
Created November 2, 2019 23:27
Segment.io Analytics.js usage on Webflow
// STEP 0:
// add the segment JS web snippet with your custom segment key to your header on webflow. this is found at your webflow project's dashboard -> custom code -> header.
// STEP 1:
// in the web flow editor, click any element you want to track when clicked, go to its settings, and add custom attributes that follow this pattern:
/*
~required~ you must add a data-analytics attribute
data-analytics="YOUR_EVENT_NAME_HERE"
@nandorojo
nandorojo / React Navigation Shared Element Transitions.md
Last active February 26, 2024 04:29
Shared Element Transitions with React Navigation and Expo (2019)

Shared Element Transitions with React Navigation and Expo (2019)

It's 2019, and creating smooth shared element transitions in react native (& expo!) is finally easy.

Ideally, as Pablo Stanley suggests, your app's navigation will use these shared transitions for similar components that appear across screens.

Is it possible to achieve the great experience above using react-native/expo? Now it is.

@nandorojo
nandorojo / App.js
Last active March 23, 2020 18:58
Doorman + React Navigation Example (v5)
// IN ORDER TO USE THIS, YOU NEED TWO THINGS
// 1. Your firebase config, to be replaced on line 12
// 2. Your Doorman public project ID, to be replaced on line 27. (Go to https://app.doorman.cool to find it.)
import * as React from 'react';
import { DoormanProvider, AuthGate } from 'react-native-doorman'
import AuthStack from './Stack' // <-- made in step #2 😇
// initialize firebase
@nandorojo
nandorojo / App.js
Last active March 26, 2020 03:13
Doorman + React Navigation Example (v4)
// IN ORDER TO USE THIS, YOU NEED TWO THINGS
// 1. Your firebase config, to be replaced on line 13
// 2. Your Doorman public project ID, to be replaced on line 30. (Go to https://app.doorman.cool to find it.)
import * as React from 'react';
import AuthStack from './Stack' // <-- made in step #2 😇
import { DoormanProvider, AuthGate } from 'react-native-doorman'
import { createAppContainer } from 'react-navigation'
import { Text } from 'react-native'
@nandorojo
nandorojo / WithAuthGate.tsx
Created April 1, 2020 08:24
AuthGate example
import React from 'react'
import { useAuthGate } from 'react-native-doorman'
class LoadingScreen extends React.Component {
componentDidMount() {
const { loading, user } = this.props
// ...navigate here
}
@nandorojo
nandorojo / main.js
Created May 23, 2020 02:40
Expo Electron main.js
// electron/main/index.js
// in your expo project, after following the docs instructions, run:
// yarn expo-electron customize
// then set your electron/main/index.js to look like this
import { BrowserWindow, Tray, app } from 'electron'
import * as path from 'path'
import { format as formatUrl } from 'url'
import debug from 'electron-debug'
@nandorojo
nandorojo / knew.md
Last active April 7, 2024 23:27
What I wish I knew when I started with Expo Web, React Navigation & Next.js

I started using React Native in September 2018. I always forget some things when I build new apps, so I'll keep track of the gotchas on this post.

Some topics, such as navigation, will be fundamental to how I think about apps. Others, will be one-line helpers that make apps work more smoothly.

It's gotten to the point where I find my own answers from 6 months before on certain Github issues.

I'll keep adding over time as I think of more. If anyone thinks these topics would be useful, let me know and I'll elaborate.

I have made libraries to address a number of the topics here, from navigation to design.