Skip to content

Instantly share code, notes, and snippets.

@phund
phund / gist:5daca82379d38ddad201
Created February 19, 2016 02:53 — forked from weberste/gist:354a3f0a9ea58e0ea0de
Dates only with Angular-UI Bootstrap datepicker
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
@phund
phund / gist:b0e31f1fd180a0ccd8b49838d8004fc1
Created May 15, 2016 01:22
Update branch name in local and remote
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@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
@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;
}

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: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. //
// //
//////////////////////////////////////////////////////////////////////////
@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:b168211138d042be134e8122c515a177
Last active August 30, 2016 07:41
Meteor use deeplink with cordova-plugin-customurlscheme@4.1.3
  1. Add cordova plugin meteor add cordova:cordova-plugin-customurlscheme@4.1.3
  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: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.
@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.