This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const memoizeFactory = hashFn => fn => { | |
const memoize = fn => { | |
const cache = {}; | |
return (...args) => { | |
const key = hashFn(args); | |
if (key in cache) { | |
return cache[key]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Fix RN version 33 | |
yarn list react-native |grep react-native |grep 0.33 | |
if [ $? -eq 0 ]; | |
then | |
echo "Checking that ReactNative v 33 is patched" | |
cd node_modules/react-native | |
patch -N -p1 --dry-run --silent < ../../notes/rn33.3x.patch >/dev/null 2>&1 | |
if [ $? -eq 0 ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { resolve } from 'path' | |
import { GatsbyCreatePages } from './types' | |
const createPages: GatsbyCreatePages = async ({ | |
graphql, | |
boundActionCreators, | |
}) => { | |
const { createPage } = boundActionCreators | |
const allMarkdown = await graphql(` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global __DEV__*/ | |
import StackTrace from 'stacktrace-js'; | |
const Fabric = require('react-native-fabric'); | |
const { Crashlytics } = Fabric; | |
//call this to start capturing any no-handled errors | |
exports.init = function(captrueOnDebugMode){ | |
if (__DEV__ && !captrueOnDebugMode) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// BackgroundTask.h | |
// tomtrack | |
// | |
// Created by Liam Edwards-Playne on 13/02/2016. | |
// | |
#import "RCTBridgeModule.h" | |
@interface BackgroundTask : NSObject <RCTBridgeModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*************************************************** | |
* Simple and elegant, no code complexity | |
* Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records) | |
* (This disadvantage should go away as we add optimizations to the core product) | |
***************************************************/ | |
var fb = firebase.database.ref(); | |
/** | |
* @param {string} emailAddress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to nginx.conf http section | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} |