Skip to content

Instantly share code, notes, and snippets.

@lixw1021
lixw1021 / Check mongodb data on AWS linux.pm
Created January 23, 2018 18:46
Check mongodb data on AWS linux steps
1 run mongo: sudo mongo
2 display db: show dbs
3 switch db: use <your db name>
4 show collections: show collecitions
5 db.<collection bame>.find().pretty()
@lixw1021
lixw1021 / Deploy nodejs-express-mongoDB on AWS .md
Last active January 25, 2021 13:52
Deploy nodejs-express-mongoDB on AWS

Deploy nodejs-express-mongoDB backend on AWS EC2 Ubuntu(16.04)

Back-end is a private repo on Gitlab.

Steps:

1: Create EC2 Ubuntu server on AWS, create EC2 instance

2: Connect personal computer with AWS server - use to control cloud Ubuntu server on personal computer,

@lixw1021
lixw1021 / gist:d8cd50eadb2d0520e84a74189d5d25ed
Created October 26, 2017 19:47
安卓 防止密钥上传到Github
第一步: 创建secrets.xml文件, 并保存密钥
<!-- Inside of `res/values/secrets.xml` -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="parse_application_id">xxxxxx</string>
<string name="parse_client_secret">yyyyyy</string>
<string name="google_maps_api_key">zzzzzz</string>
</resources>
第二步: 使用密钥,AS会自动将文件并入项目,可以直接当String是使用
@lixw1021
lixw1021 / MainActivityAdapter.java
Last active August 19, 2017 21:39
Reuse Fragment in ViewPager
public class MainActivityAdapter extends FragmentPagerAdapter {
List<String> tableTitles;
List<String> urls;
public MainActivityAdapter(FragmentManager fm, List<String> tableTitles, List<String> urls) {
super(fm);
this.tableTitles = tableTitles;
this.urls = urls;
}