Skip to content

Instantly share code, notes, and snippets.

@daominhsangvn
daominhsangvn / CustomClientFactory
Created July 30, 2020 04:27 — forked from ecdundar/CustomClientFactory
React Native HTTPS Certificate Error Problem - Trust All Certificates
package com.myapplication.extensions;
import android.util.Log;
import com.facebook.react.modules.network.OkHttpClientFactory;
import com.facebook.react.modules.network.OkHttpClientProvider;
import com.facebook.react.modules.network.ReactCookieJarContainer;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
@daominhsangvn
daominhsangvn / wildcard-ssl-certificate.md
Created January 4, 2019 02:54 — forked from talyguryn/wildcard-ssl-certificate.md
How to get a wildcard ssl certificate and set up Nginx.

How to get and install a wildcard SSL certificate

In this guide you can find how to resolve the following issues.

Feel free to ask any questions in the comments section below.

@daominhsangvn
daominhsangvn / package-exact.js
Created May 11, 2018 03:02 — forked from kentcdodds/package-exact.js
make your package.json dependencies be the exact version that's in your node_modules currently
/* jshint node:true */
/* eslint-env node */
/*
* This will look at the current version of all of your dependencies and update your package.json
* with the specific version that you currently have in node_modules. This will save you from the
* sadness that is: DEPENDENCY MANAGEMENT
*
* Place this file in a folder that's a a sibling to your package.json and node_modules
* Then simply run: node scripts/package-strict
@daominhsangvn
daominhsangvn / letsencrypt_2017.md
Last active January 4, 2019 04:32 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@daominhsangvn
daominhsangvn / redux-react-nagivation-integration.md
Last active October 31, 2017 08:43 — forked from hle50/rm.md
Integrate React into React with React-Navigation
  1. Install redux $ yarn add react-redux
  2. At project root folder, create folder store then create file configureStore.js in store folder:
import { createStore } from 'redux';
 
import reducers from '../reducers'
 
export default function configureStore(initialState) {
  const store = createStore(
    reducers,
@daominhsangvn
daominhsangvn / deploy-front-end-nodejs-to-aws-ec2-linux.md
Last active September 27, 2017 07:16 — forked from hpphat92/GUIDELINE_AWS.md
How to deploy front-end (AngularJS, Angular, ReactJS...) and nodejs to AWS EC2 Linux

How to deploy front-end (AngularJS, Angular, ReactJS...) and nodejs to AWS EC2 Linux

Preparation

  • PEM file containing private key from AWS server.
  • A domain to server
  • GIT Bash (In Window, can't use command line tool or powershell).

Steps:

Step 1: Connect to server:

@daominhsangvn
daominhsangvn / gist:454388252d541fbbc8b41c622c3c4e76
Created May 30, 2017 08:22 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"