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
class Parallel < Formula | |
desc "Shell command parallelization utility" | |
homepage "https://savannah.gnu.org/projects/parallel/" | |
url "https://ftp.gnu.org/gnu/parallel/parallel-20191122.tar.bz2" | |
mirror "https://ftpmirror.gnu.org/parallel/parallel-20191122.tar.bz2" | |
sha256 "182a93155dea12ddc36b7e85fd2d8342d7a88e7a449e4161a5a291e1f4989507" | |
head "https://git.savannah.gnu.org/git/parallel.git" | |
bottle do | |
cellar :any_skip_relocation |
javascript: (function() { | |
var root = $(document.getElementsByTagName('html')); | |
var watchers = []; | |
var attributes = []; | |
var attributes_with_values = []; | |
var elements = []; | |
var elements_per_attr = []; | |
var scopes = []; |
# Add field | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
# { | |
# "hello": "world", | |
# "foo": "bar" | |
# } | |
# Override field value | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
{ |
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
If you ever need a mobile application, you probably have an API endpoint to talk to. And if you're doing it right, you should have different environment for your API, usually it'll be: dev, staging, production.
We dont' want to perform test againts the production API. We need a way to teach our app to talk to different API environment. But what is the switch?
The naive way:
# Assumes htpass authentication | |
registry_server='docker.mycloud.com' | |
username='bob' | |
# List all images (i.e. repositories) | |
curl -k -X GET "https://$registry_server/v2/_catalog" -u $username -H "Accept: application/json" | |
Enter host password for user 'bob': | |
{"repositories":["app-base","ubuntu","cache-base"]} | |
curl "YOUR_WEBHOOK" -d '{"text":"https://twitter.com/cdixon/status/591658510007410688"}' |
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
import React, { Component } from 'react' | |
import { Redirect } from 'react-router' | |
export default class Search extends Component { | |
constructor () { | |
super(); | |
this.state = { | |
fireRedirect: false | |
} | |
} |
I hereby claim:
To claim this, I am signing this object: