Settings up mutliple app targets in React-Native
yarn add react-native-config
react-native link react-native-config
- Create
.env
files for each configuration. Ex:.env.dev
,.env.prod
, etc Ex:
API_ENDPOINT=https://api.myresource.com/dev
ENV=dev
yarn add react-native-config
react-native link react-native-config
.env
files for each configuration. Ex: .env.dev
, .env.prod
, etc
Ex:API_ENDPOINT=https://api.myresource.com/dev
ENV=dev
// | |
// ViewController.swift | |
// citizencrossfit | |
// | |
// Created by Mark Jackson on 17/11/2014. | |
// Copyright (c) 2014 Mark Jackson. All rights reserved. | |
// | |
import UIKit | |
import Alamofire |
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
let calendar = NSCalendar.currentCalendar() | |
let now = NSDate() | |
let earliest = now.earlierDate(date) | |
let latest = (earliest == now) ? date : now | |
let components:NSDateComponents = calendar.components([NSCalendarUnit.Minute , NSCalendarUnit.Hour , NSCalendarUnit.Day , NSCalendarUnit.WeekOfYear , NSCalendarUnit.Month , NSCalendarUnit.Year , NSCalendarUnit.Second], fromDate: earliest, toDate: latest, options: NSCalendarOptions()) | |
if (components.year >= 2) { | |
return "\(components.year) years ago" | |
} else if (components.year >= 1){ |
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from "react"; | |
import { Platform, StyleSheet, Text, View } from "react-native"; | |
import Config from "react-native-config"; |
apply plugin: "com.android.application" | |
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle" | |
import com.android.build.OutputFile | |
project.ext.react = [ | |
entryFile: "index.js" | |
] |
import API from '../api' | |
export const loginUser = (email, password) => API.post('/auth/signin', {}, {email, password}) | |
export const retrieveCurrentUser = () => API.get('/user') |
import { Observable } from 'rxjs' | |
import axios from 'axios' | |
const API_BASE = '.sampleserve.net/api/v1' | |
const SUB_DOMAIN = 'test' // TODO: Add to store for other lab subdomains | |
const PROTOCOL = 'http' | |
/** | |
* @param {Object} Headers for HTTP request. | |
* @return {Object} Headers with `Accept` and `Content-Type` added. |
import Rx from 'rxjs' | |
import { loginUser, retrieveCurrentUser } from '../api/users' | |
import { combineEpics } from 'redux-observable' | |
import { | |
LOGIN_USER, LOGIN_USER_CANCELLED, LOGIN_USER_SUCCESS, | |
RETRIEVE_CURRENT_USER, RETRIEVE_CURRENT_USER_CANCELLED | |
} from '../constants/UserActionTypes' | |
import { | |
loginUserSuccess, loginUserError, | |
retrieveCurrentUser as retrieveCurrentUserAction, retrieveCurrentUserSuccess, retrieveCurrentUserError |
expr -- (void)printf("[%s, %s]\n",(char *) object_getClassName(*(long*)($esp+4)), (char *) *(long *)($esp+8) ) |
// Key sections of code for this implementation are placed below | |
@interface JSTableWithFixedHeaderViewController () | |
@property (strong, nonatomic) UIView *fixedHeaderView; | |
@end | |
@implementation JSTableWithFixedHeaderViewController |