Skip to content

Instantly share code, notes, and snippets.

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

Josh de la Peña jjdp

🏠
Working from home
View GitHub Profile
@jjdp
jjdp / use-dropzone.tsx
Created October 18, 2021 08:34 — forked from timc1/use-dropzone.tsx
A React hook that returns whether a file is being dragged into the document from the operating system and not from within the browser.
import React from 'react'
type DropzoneContextValue = {
isDragging: boolean
}
const DropzoneContext = React.createContext<DropzoneContextValue | undefined>(
undefined
)
@jjdp
jjdp / index.js
Created April 3, 2019 06:41
PhotoView
// @flow
import React, { Component } from 'react';
import {
View,
Dimensions,
Text,
TouchableOpacity,
Image
} from 'react-native';
@jjdp
jjdp / server.js
Last active April 3, 2019 02:57
Parse-Server
var express = require("express");
var ParseServer = require("parse-server").ParseServer;
var RedisCacheAdapter = require('parse-server').RedisCacheAdapter;
var redisCache = new RedisCacheAdapter({
host: process.env.REDIS_HOST,
port: process.env.REDIS_PORT || 6379
});
var app = express();
@jjdp
jjdp / firebase-sandbox.md
Last active February 20, 2018 11:44 — forked from cohenadair/firebase-sandbox.md
Setting up development and production Firebase environments for iOS

Firebase Environments

At the time of writing this gist (January 4th, 2017), I was unable to find true sandboxing to separate development and production environments for a Firebase project. The closest we can get is to create two separate Firebase projects -- one for development and one for production.

Pros

  • Complete separation and isolation of all Firebase features.
  • Freedom to experiment without risking the corruption of production data.

Cons

  • There is no way to copy production data to your development project (that I am aware of).
  • Any settings changes made to your development project also needs to be manually applied to your production project.