Skip to content

Instantly share code, notes, and snippets.

View minhtri9111199's full-sized avatar

Tri Pham minhtri9111199

  • 08:44 (UTC +07:00)
View GitHub Profile
@phund
phund / meteor_forever_capistrano_monit.markdown
Last active October 25, 2016 06:39
Deploy meteor with forever, capistrano and monit on a EC2

How to deploy meteor app with forever capistrano 3.6.1 and monit (current test with meteor 1.4.1 and ubuntu server 14.04 - EC2)

Step 1: Install enviroment on server

  1. Install node, mongodb... (Please see https://gist.github.com/phund/7372628980516376dfe5eaf8a559428d for more detail)
  2. Install monit

Step 2: Setup capistrano in local

  1. Install ruby
@phund
phund / Deploy meteor app with nginx and passenger.markdown
Last active March 30, 2017 11:34
Deploy meteor app with nginx and passenger

How to deploy meteor app with nginx and passenger (current test with meteor 1.4.1 and ubuntu server 14.04)

Step 1: Setup server enviroment

Install nginx and passenger

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
sudo apt-get install -y apt-transport-https ca-certificates

--- Add our APT repository

@phund
phund / build-release.sh
Created June 15, 2016 09:59 — forked from rknell/build-release.sh
Build Android Release apk from Cordova /CLI
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.
@phund
phund / gist:51d00ce5a2b3ae2d90b082099fff0afc
Last active August 30, 2016 07:41
Build a cordova plugin
https://taco.visualstudio.com/en-us/docs/createplugintutorial/
1. Install plugman
npm install -g plugman
2.
  1. Add cordova plugin meteor add cordova:[email protected]
  2. Add config on mobile-config.js App.configurePlugin('cordova-plugin-customurlscheme', { URL_SCHEME: '<name_of_scheme (ex: openapp => openapp://link/to/path)>' });
  3. Add handle open url function on js window.handleOpenURL = function handleOpenURL(receiveUrl) { setTimeout(function() { let url = receiveUrl;
@phund
phund / gist:1233fa7d9cbc2811eb4117e15a2182b4
Last active August 30, 2016 07:41
meteor cordova google plus
-Override corrdova build. Fix crash app
```
java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.IllegalStateException: Incorrect provider authority in manifest. Most likely due to a missing applicationId variable in application's build.gradle.
```
Note: Add override after meteor reset or catch error
```
.meteor/local/cordova-build/platforms/android" is not an Android project.
```
<project-dir>/cordova-build-overrride/flatforms/android/build-extra.grade
@phund
phund / gist:955c84476681a16047b40e1ed526b4e3
Created May 24, 2016 06:31
mrt_accounts-facebook-cordova.js
//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////

How to get facebook login working with Meteor and Cordova on iOS

Step 1: Make your local dev site internet accessible

Because there is an issue with OAuth2 login and localhost development, you currently have to deploy your meteor site to be able to test the Facebook login. A nice little workaround for this is to make the local instance of meteor accessible externally.

There is a great online guide for setting up port forwarding with your router and you can check your public external IP here.

For example, If you have an Apple router, simply open up Airport Utility on your Mac and click edit on your router, then go to the Network tab. Under Port Settings click the + icon and select Personal Web Sharing, setting all of the public and private ports to 3000. Make sure the private IP is set to your current computer IP.

@phund
phund / gist:23b8e60092f2f729e0f3911234faf9cf
Last active August 30, 2016 07:41
Ionic fix bug: collection-repeat tried to compute the height of repeated elements "{item} in {items}", but was unable to. Please provide the "item-height" attribute
When use ionic with cache and collection repeat => catch unexpected errors
reference: https://forum.ionicframework.com/t/please-help-test-angular-1-3-improved-transitions-cached-views-etc/12528/160
[nav-view="cached"] {
display: initial;
visibility: hidden;
}
@phund
phund / gist:e8f4ec616acf6f3a18021d8b0cb21b73
Last active June 19, 2017 20:38
Deploy meteor app to heroku
1. Install heroku
reference: https://toolbelt.heroku.com
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
2. create a heroku app
heroku login
heroku apps:create foobar
3. Set a Meteor buildpack for your Heroku instance
reference: https://elements.heroku.com/search/buildpacks?q=meteor